Handling Multiple Valid Interceptions of a Request: The Andrej Karpathy Claude Skill Guide

The andrej-karpathy-skills repository forces Claude to enumerate every plausible interpretation of ambiguous requests—such as "make the search faster"—and obtain explicit user confirmation before generating code, eliminating assumption-driven development.

The andrej-karpathy-skills repository maintained by forrestchang packages Andrej Karpathy's coding philosophy into a structured Claude skill that prevents LLMs from guessing intent. By encoding the "Think Before Coding" principle in CLAUDE.md and skills/karpathy-guidelines/SKILL.md, this knowledge-base mandates handling multiple valid interpretations of a request through forced clarification checkpoints rather than immediate implementation.

The Think Before Coding Principle

The primary mechanism for addressing ambiguity resides in the Think Before Coding guideline defined in [CLAUDE.md](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md). This principle requires Claude to list assumptions, ask clarifying questions, and present all plausible interpretations before committing to an implementation path.

When activated, the skill intercepts vague prompts—such as performance improvements or feature requests—and compels the model to surface distinct valid interpretations. For example, the phrase "make the search faster" could imply optimizing database indexes, converting synchronous calls to async, or improving perceived latency through UI changes. The skill forces Claude to present these as discrete options rather than selecting one arbitrarily.

Repository Architecture and Key Files

The knowledge-base consists of structured documentation rather than executable code, organized across five critical components:

Installing the Karpathy Guidelines

You can activate these constraints in Claude Code through the marketplace interface or manual download.

Via Claude Code Marketplace:

/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skills

Manual Installation (for any LLM workflow):

curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md

Once installed, Claude treats the four principles—including the requirement to handle multiple valid interpretations—as binding constraints on all subsequent code generation tasks.

Real-World Example: Resolving "Make the Search Faster"

The [EXAMPLES.md](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/EXAMPLES.md) file demonstrates how the skill transforms an ambiguous request into a structured clarification dialogue. When a user enters:

Make the search faster

Claude responds with enumerated interpretations rather than immediate code:

Interpretation 1 – Faster response time
– Add DB indexes, introduce caching.
Interpretation 2 – Higher throughput
– Convert the function to async, pool connections.
Interpretation 3 – Perceived speed
– Emit progressive results, show a loading spinner.

Only after the user selects the specific interpretation does Claude proceed to implement the corresponding solution. This workflow exemplifies how the repository eliminates guesswork by exposing ambiguity as a structured choice.

Implementation: Surgical Changes After Clarification

Once an interpretation is confirmed, the skill enforces Simplicity First and Surgical Changes principles from CLAUDE.md. Consider a bug report stating "empty emails crash the validator." Rather than refactoring the entire validation module, Claude proposes minimal, targeted modifications:

- if not user_data.get('email'):
+ email = user_data.get('email', '')
+ if not email or not email.strip():
     raise ValueError("Email required")

This diff demonstrates that only the email validation logic changes; unrelated username checks or other validation steps remain untouched, adhering to the goal-driven, minimal-impact philosophy encoded in the skill.

Summary

  • The andrej-karpathy-skills repository encodes Andrej Karpathy's "Think Before Coding" philosophy into a reusable Claude skill.
  • The primary mechanism for handling multiple valid interpretations requires Claude to enumerate all plausible scenarios—such as latency versus throughput optimizations—and await user selection.
  • Key implementation files include CLAUDE.md (human-readable principles), SKILL.md (machine-readable manifest), and EXAMPLES.md (concrete ambiguity-resolution scenarios).
  • Installation occurs via /plugin install in Claude Code or direct download of CLAUDE.md for custom LLM pipelines.
  • Post-clarification, the skill enforces Surgical Changes, ensuring only necessary lines are modified to fulfill the confirmed interpretation.

Frequently Asked Questions

What is the Andrej Karpathy Skills repository?

The andrej-karpathy-skills repository by forrestchang is a knowledge-base that packages Andrej Karpathy's coding guidelines into a structured Claude skill. It contains no executable source code; instead, it provides Markdown-based behavioral constraints in CLAUDE.md and SKILL.md that force Claude to resolve ambiguity before generating implementations.

How does the skill handle requests with multiple valid interpretations?

According to the Think Before Coding principle in CLAUDE.md, the skill compels Claude to list every plausible interpretation of an ambiguous request—such as distinguishing between database optimization, async conversion, or UI improvements for "make the search faster"—and present them as discrete options. Claude must obtain explicit user confirmation on which interpretation to pursue before writing code.

Can I use these guidelines outside of Claude Code?

Yes. While the repository includes .claude-plugin/plugin.json for native Claude integration, you can manually download CLAUDE.md via curl and append its constraints to any LLM prompt template. The behavioral principles are encoded in plain Markdown, making them portable to GPT-4, Llama, or other model contexts.

What are the four principles defined in the skill?

The four behavioral guidelines enumerated in CLAUDE.md and SKILL.md are: Think Before Coding (surface assumptions and interpretations), Simplicity First (minimal code only), Surgical Changes (modify exactly the lines required), and Goal-Driven Execution (define verifiable success criteria before implementing).

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →