Claude Code is fast, but it has habits. It guesses what you meant instead of asking, it writes 200 lines where 50 would do, and it "tidies" code you never mentioned. A single file of rules can curb most of that. andrej-karpathy-skills is a CLAUDE.md built from Andrej Karpathy's complaints about LLM coding. The short version is on the Deduped use-case page. Here is the full setup with the exact commands from the README.
The problem it targets
The README quotes Karpathy on three failure modes:
- Models make wrong assumptions on your behalf and run with them without checking.
- They overcomplicate code and APIs, bloat abstractions and leave dead code behind.
- They change or remove comments and code they do not understand, as side effects.
The four principles
The file packs four rules:
- Think Before Coding. State assumptions, present multiple interpretations, push back when a simpler approach exists, and stop and ask when confused.
- Simplicity First. No features beyond what was asked, no abstractions for single-use code, no configurability nobody requested, no error handling for impossible scenarios. If 200 lines could be 50, rewrite it.
- Surgical Changes. Do not improve adjacent code, match the existing style, mention unrelated dead code instead of deleting it, and only remove orphans your own change created.
- Goal-Driven Execution. Turn "fix the bug" into "write a test that reproduces it, then make it pass."
The test the README gives for rule 3 is a good one: every changed line should trace directly to your request.
Option A: install as a Claude Code plugin
Inside Claude Code, add the marketplace first:
/plugin marketplace add forrestchang/andrej-karpathy-skills
Then install the plugin:
/plugin install andrej-karpathy-skills@karpathy-skills
This makes the guidelines available across all your projects.
Option B: drop a CLAUDE.md into one project
For a new project:
curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md
For an existing project, append so you keep your own rules:
echo "" >> CLAUDE.md
curl https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md >> CLAUDE.md
If you want it on one repo first, this is the safer route. There is a walkthrough on the one-project use-case page.
Using it with Cursor
The repo ships a committed Cursor project rule at .cursor/rules/karpathy-guidelines.mdc, so the same guidelines apply when you open it in Cursor. See CURSOR.md in the repo for using the rule in other projects.
Add your own project rules
The guidelines are meant to be merged with yours. The README suggests adding a section like this:
## Project-Specific Guidelines
- Use TypeScript strict mode
- All API endpoints must have tests
- Follow the existing error handling patterns in `src/utils/errors.ts`
How to tell it is working
The README lists four signs:
- Fewer unnecessary changes in diffs.
- Fewer rewrites due to overcomplication.
- Clarifying questions come before implementation, not after mistakes.
- Clean, minimal PRs with no drive-by refactoring.
Check this on your next three tasks. If diffs get smaller and Claude asks a question before it starts, it is doing its job.
The tradeoff
The guidelines bias toward caution over speed. For trivial work like a typo fix or an obvious one-liner, the extra deliberation is overhead, so use judgment. The same idea of success criteria is covered in turning tasks into verifiable goals.
More ways people use this repo are on its Deduped page.
Want the setup commands for 50 AI repos people actually ship with? Get the free AI Repos That Actually Ship pack: https://dedupedai.com/ship-pack/?utm_source=devto&utm_medium=article&utm_campaign=shippack
Top comments (0)