Four rules from Karpathy that fix most agent coding mistakes
andrej-karpathy-skills is a single CLAUDE.md built from Andrej Karpathy's posts about where coding models go wrong: unchecked assumptions, overcomplicated code, and edits to things nobody asked to change. It boils that down to four rules.
The rules
Think before coding. State your assumptions, and when a request can mean two things, say so instead of silently picking one.
Simplicity first. The minimum code that solves the problem. No speculative features or one-use abstractions.
Surgical changes. Touch only what the task needs, match the existing style, and mention dead code rather than deleting it.
Goal-driven execution. Turn the task into something checkable, such as a failing test, then make it pass.
Install
As a Claude Code plugin:
/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skillsOr drop the file into one project:
curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.mdThere's a Cursor rule in the repo too.
Why it works
The last rule does most of the work. An agent with a clear finish line, like a test that has to pass, stops wandering. If you only adopt one habit, give every task a way to prove it's done.
Discussion (0)