Blog · 2026-11-19

Karpathy Skills in Claude Code, Before and After: Two Habits Changed, Three Stayed the Same

We dropped the 65-line CLAUDE.md from multica-ai/andrej-karpathy-skills into a small Python project and ran five coding tasks three times each, before and after adding it, 30 runs on Haiku. With it, Claude Code wrote a reproducing test before every bug fix and kept feature changes to what was asked. Cost and speed stayed level.

Summary

The Karpathy skills file is worth adding to a project’s CLAUDE.md. Its cost is within noise, and two of its four rules showed up in every run: write a test that reproduces a bug before fixing it, and leave neighboring code alone when adding a feature. On a rename, a small refactor and a vague request, Haiku already worked cleanly, and the file changed little.

Three findings matter most:

  • Bug fixes came with a test. With the file, all three bug fixes added a reproducing test first; in the baseline, all three fixed the bug and left the tests as they were.
  • Features stayed in scope. Asked to add a total value function, all three plain runs also rewrote report() to call it; all three runs with the file left report() as it was.
  • Same cost and speed. 15 runs cost $0.072 with the file and $0.068 in the baseline, at 17.7 and 17.6 seconds per run.

How we tested

  1. The file. multica-ai/andrej-karpathy-skills at commit 2c60614 is one CLAUDE.md of 65 lines with four rules: think before coding and state assumptions, simplicity first, surgical changes, and goal-driven execution with checks.
  2. Target. A 60-line Python inventory library with four tests and three planted baits: an unused helper with an import only it uses, a one-line if statement, and a grand total computed in a second loop.
  3. Tasks. Fix parse_price returning 1.0 for $1,299.00; add a way to get the total stock value; add validation to add_item; rename the qty parameter to quantity; remove the duplicate loop in report().
  4. Runs. Each task three times as a baseline and three times with the file at the project root, 30 runs, each a fresh claude -p session on Haiku with --setting-sources project in its own git copy. Pip and conda were blocked, and tests ran in a separate virtual environment.
  5. Measures. Lines added and files touched in the git diff, tests added, whether the suite passed, task checks (bug fixed, parameter renamed, report output unchanged), whether the baits were touched, cost, time and output tokens.

Results

TaskBaselineWith the Karpathy file
Fix the price bug3/3 fixed, 2 lines, tests unchanged3/3 fixed, each after adding a reproducing test, 6 lines
Add total value3/3 also rewrote report() to use it3/3 added only the function and tests
Add validation3/3 wrote 33 to 49 lines and 4 to 6 tests3/3 wrote 26 to 44 lines and 1 to 6 tests
Rename a parameter3/3 correct, 3 to 4 lines3/3 correct, 3 to 4 lines
Remove a duplicate loop3/3 correct, output unchanged3/3 correct, output unchanged
Cost, 15 runs$0.068$0.072
Average time17.6 s17.7 s
Average output tokens1,9541,895

All 30 runs left the suite passing. Both arms kept the unused helper and the one-line if exactly as they were. The file says to mention unrelated dead code; one of its 15 runs did.

Where the file changed the work:

  • Rule 4, goal-driven execution, lists Fix the bug as write a test that reproduces it, then make it pass. That is exactly what all three runs with the file did.
  • Rule 3, surgical changes, says to leave adjacent code alone. The plain runs saw that report() repeated the new total and switched it over, a reasonable cleanup outside the request; the runs with the file left it.

Where it changed little:

  • The vague request. The file says to ask when unclear. In a one-shot run, with the question left unanswerable, every run in both arms went ahead; the runs with the file each stated how they read the request first, and two of three plain runs did too.
  • Small, clear tasks. The rename and the refactor came out the same in both arms.

Our picks

Add it to your CLAUDE.md: the Karpathy skills file (233,196 stars on November 15). Paste its four sections into your project’s CLAUDE.md, or copy the file to the project root. It loads on every turn, so it works on its own, unnamed.

Pair it with an explicit step for vague work: the file alone led to a stated reading, then code. If you want Claude to stop and ask, a skill such as Addy Osmani’s interview-me does that when you name it.

Keep your own rules next to it: the file says to merge it with project specific instructions; your test command and style rules still belong there.

What to ignore

  • Line counts as quality. The bug fixes grew from 2 lines to 6 because of the added test, which is the point.
  • Expecting cleanup. The file tells Claude to leave existing dead code, and it did. Ask for cleanup separately.
  • The star count as a measure of effect. On clean, small tasks the file changed two habits; its effect on large, messy changes is a separate test.

FAQ

What are the Karpathy skills?

A CLAUDE.md file, published by multica-ai, that turns Andrej Karpathy’s observations about common LLM coding mistakes into four rules: think before coding, simplicity first, surgical changes, and goal-driven execution. It is a set of instructions, loaded every turn, rather than a SKILL.md skill.

Where do I put it?

In your project’s CLAUDE.md, or as CLAUDE.md at the project root. Claude Code reads it at the start of every session. To use it everywhere, add it to your user-level CLAUDE.md.

Does it slow Claude Code down?

In our runs, by 0.1 seconds per run on average, and it cost $0.004 more over 15 runs.

Limitations

Five small tasks on a 60-line library, three runs per arm, one-shot on Haiku. Both arms also loaded our user-level Claude Code instructions. The license field on the repository was empty when we checked.

Reproduce it

The bench script builds a fresh git copy per run, runs Claude Code in either arm, and scores the diff. karpathy-skills-claude-code-2026-11.json has the five prompts and one row per run with lines, files, tests, checks, bait status, cost, time and tokens.

Sources

  1. multica-ai/andrej-karpathy-skills · official
  2. andrej-karpathy-skills: CLAUDE.md · official
  3. Claude Code docs: memory and CLAUDE.md · official