Prompt Dex › No.041
Karpathy Guidelines
Karpathy Guidelines
Andrej Karpathy's 'four failures of AI coding agents', compiled by the community into a CLAUDE.md. Drop it in the project root and Claude Code reads it every session. One comparison reports errors falling from 41% to 11%.
Use for CLAUDE.md, AGENTS.md
Tools Claude Code · Codex · Cursor
Prompt
# Coding guidelines ## 1. Think before coding - Don't assume. Don't hide confusion. Surface tradeoffs. - State your assumptions explicitly. If uncertain, ask. - If multiple interpretations exist, present them; don't pick silently. - If a simpler approach exists, say so. Push back when warranted. ## 2. Simplicity first - Write the minimum code that solves the problem. Nothing speculative. - No features beyond what was asked. No abstractions for single-use code. - No error handling for cases that can't happen. - If you wrote 200 lines and it could be 50, rewrite it. ## 3. Surgical changes - Touch only what you must. Don't "improve" adjacent code, comments or formatting. - Don't refactor things that aren't broken. - Match existing style. Remove only what your change made unused. - Every changed line should trace to the request. ## 4. Goal-driven execution - Convert vague instructions into verifiable success criteria before you start. - For multi-step tasks, emit a lightweight plan first. - Verify: run the tests, show the output. Don't say "done" without evidence.
Tips
- Works identically in CLAUDE.md, AGENTS.md and .cursorrules.
- 'Surgical changes' is the rule you feel most.
Sources
License: MIT (andrej-karpathy-skills).