GitHub - forrestchang/andrej-karpathy-skills: A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
This project packages four principles—Think Before Coding, Simplicity First, Surgical Changes, and Goal-Driven Execution—into a Claude Code plugin or CLAUDE.md file to curb LLM code pitfalls like overengineering and hidden assumptions. It enforces explicit reasoning, minimal edits, and test-driven success criteria to produce cleaner, more accurate AI-generated code.
- A single CLAUDE.md file encodes four Karpathy-derived rules—think before coding, simplicity first, surgical changes, goal-driven execution—to fix common LLM coding failures.
- It explicitly bans unrequested abstractions, error handling, or flexibility, and restricts edits to only what was asked, leaving style and unrelated code untouched.
- It pushes test-first, criteria-based execution so the model loops until defined success conditions pass rather than coding aimlessly.
- Installable as a Claude Code plugin/marketplace package or via curl into CLAUDE.md, with a Cursor rule file and support for project-specific rule additions.
Forrest Chang’s repo packages Andrej Karpathy’s hard-won lessons on LLM coding into a single CLAUDE.md file or a Claude Code plugin. You can grab the file directly into any project or install it via the Claude Code marketplace. Either way, you get four clear rules that tackle real LLM missteps: making bad assumptions, overengineering, unintended edits, and aimless execution.
Principle one forces the model to lay out assumptions, offer alternatives, and ask questions when it’s stuck. Principle two clamps down on feature bloat—no abstractions, error handling, or flexibility beyond what you asked. Principle three limits edits to exactly what your request demands—style, structure, and unrelated dead code stay untouched. Principle four turns tasks into verifiable goals: write tests first, define success criteria, then loop until they pass.
Install via “/plugin marketplace add forrestchang/andrej-karpathy-skills” plus “/plugin install” in Claude Code, or append CLAUDE.md with a curl command. A built-in Cursor rule file can enforce these same guidelines whenever you open the project in Cursor. Use project-specific sections (like “TypeScript strict mode” or “all API endpoints need tests”) to blend Karpathy’s framework with your team’s rules.