Guides Claude Code with six principles from Andrej Karpathy: think before coding, keep it simple, make surgical changes, define success criteria, reproduce bugs before fixing, and surface tradeoffs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/karpathy-code-guidelines:karpathy-guidelinesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Apply these six principles to every coding task. They exist to prevent the most common and costly LLM coding failures.
Apply these six principles to every coding task. They exist to prevent the most common and costly LLM coding failures.
Before writing any code:
Examples of what to say:
Write the minimum code that solves today's problem. Nothing speculative.
Never add, unless explicitly asked:
The test: Would a senior engineer call this overcomplicated? If yes, simplify.
If 200 lines could be 50, rewrite it.
Touch only what the task requires.
When editing existing code:
Dead code rules:
The test: Every changed line must trace directly to the user's request.
Transform imperative tasks into verifiable goals before starting.
| Instead of | Transform to |
|---|---|
| "Add validation" | "Write tests for invalid inputs, make them pass" |
| "Fix the bug" | "Write a test that reproduces it, make it pass" |
| "Refactor X" | "Ensure tests pass before and after, diff shows only renames" |
| "Make it faster" | "Response under 100ms for queries under 1000 rows" |
For multi-step tasks, state a plan with verification:
1. [Action] → verify: [specific check]
2. [Action] → verify: [specific check]
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant back-and-forth.
Never patch a bug you haven't confirmed exists.
Always follow this sequence:
If you cannot reproduce the bug, say so and ask for more context rather than guessing at a fix.
When multiple implementation approaches exist, briefly surface them before choosing.
Cover:
Keep it to 3–5 lines. Not an essay.
Example:
Two options:
- In-memory: simpler, zero deps, resets on restart
- Redis: survives restarts, works across instances, needs infra
Since you're on a single server, I'll use in-memory — easy to swap later.
Full rigor required: Any task touching auth, payments, data integrity, migrations, APIs, or multi-file refactors.
Use judgment: Trivial tasks (typo fixes, obvious one-liners, variable renames) don't need full ceremony.
The goal is preventing costly mistakes on non-trivial work — not slowing down simple tasks.
npx claudepluginhub burukalamanireethika/karpathy-inspired-claude-code-guidelinesReduces common LLM coding mistakes: think before coding, favor simplicity, make surgical changes, define verifiable success criteria. Use when writing, reviewing, or refactoring code.
Applies Karpathy guidelines to reduce LLM coding mistakes: think before coding, prioritize simplicity, make surgical changes, and define verifiable success criteria when writing, reviewing, or refactoring code.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.