[GitHub] multica-ai/andrej-karpathy-skills
Andrej Karpathy identified systematic LLM coding pitfalls: making unchecked assumptions, overcomplicating solutions, touching unrelated code, and failing to manage confusion A single CLAUDE.md file encodes four principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution) to directly address these issues The guidelines transform imperative instructions into verifiable success criteria, enabling LLMs to loop independently until goals are met Implementation is availab
Analysis
TL;DR
- Andrej Karpathy identified systematic LLM coding pitfalls: making unchecked assumptions, overcomplicating solutions, touching unrelated code, and failing to manage confusion
- A single CLAUDE.md file encodes four principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution) to directly address these issues
- The guidelines transform imperative instructions into verifiable success criteria, enabling LLMs to loop independently until goals are met
- Implementation is available as both a Claude Code plugin and a per-project CLAUDE.md file, with Cursor support included
- Success is measured by fewer unnecessary diffs, simpler first-pass code, clarifying questions before implementation, and clean minimal PRs
Why It Matters
This addresses a critical pain point for AI practitioners: LLM coding agents consistently produce overengineered, scope-creep code that requires extensive human review and correction. By encoding Karpathy's observed failure modes into actionable principles, developers can significantly reduce the cost of AI-assisted coding and improve the reliability of autonomous agent workflows.
Technical Details
- Think Before Coding: Forces explicit reasoning before implementation—state assumptions, present multiple interpretations, push back on overcomplication, and stop to ask for clarification when confused
- Simplicity First: Combats overengineering with hard constraints: no features beyond what was asked, no abstractions for single-use code, no speculative error handling, and a senior-engineer review test
- Surgical Changes: Limits edits to only what is necessary—no "improving" adjacent code or comments, match existing style, remove only imports/variables your changes made unused, and mention unrelated dead code without deleting it
- Goal-Driven Execution: Transforms tasks into verifiable goals (e.g., "write tests that reproduce the bug, then make them pass") rather than imperative instructions, leveraging LLMs' strength in iterative goal-reaching loops
- Deployment: Available as a Claude Code marketplace plugin (
forrestchang/andrej-karpathy-skills), a per-project CLAUDE.md file, and a Cursor project rule (.cursor/rules/karpathy-guidelines.mdc)
Industry Insight
- The rise of reusable "skill" files for coding agents signals a shift toward standardized behavioral guardrails—expect similar pattern libraries to emerge for other agent frameworks and tools
- Prompting LLMs with success criteria rather than step-by-step instructions is a practical technique that practitioners should adopt immediately, as it aligns with how these models actually perform best
- The bias toward "caution over speed" reflects an industry maturation: as AI coding agents become more prevalent, reducing costly mistakes on non-trivial work will matter more than marginal speed gains on simple tasks
Disclaimer: The above content is generated by AI and is for reference only.