Karpathy shares CLAUDE.md rulebook to stop AI coding agents from piling up tech debt
mdancho84 · x · 2026-10-26
mdancho84 highlights Karpathy's newly shared "CLAUDE.md: Field Notes on Getting a Language Model to Write Code You Will Not Rewrite" — not a prompt, but a discipline rulebook to keep AI coding assistants from spraying garbage across your codebase. Most users open a repo, accept the first plausible answer, and produce automated technical debt.
The ten rules:
- Read before you write: skim nothing, copy existing patterns, ask instead of guessing.
- Think before you code: state assumptions, name the tradeoff.
- Simplicity: minimum code for the problem in front of you; the test is the only reason to abstract.
- Surgical changes: a diff no bigger than the task, no drive-by reformatting.
- Verification: write the failing test first; hard-to-test is information about design.
- Goal-driven execution: success criteria before code; plan first for multi-step tasks.
- Debugging: read the whole error, reproduce before changing, no papering over with null checks.
- Dependencies: stdlib over a random package; say why when you add one.
- Communication: say what you did and why, flag concerns and uncertainty.
- Common failure modes: Kitchen Sink, Wrong Abstraction, Optimistic Path, Runaway Refactor — when you spot them, stop, don't push through.
Core thesis: AI makes bad engineering faster, so discipline must come from the process.
More from coding & agent
- Agent verified 'success' after double-voting: a lesson in harness vs model bugs — TejasKumar_ · 2026-10-26
- diginomica: agentic automation hype is overdone, and 'The Hackening' of enterprise security has begun — jonerp · 2026-10-26
- 'Vibe verification': ~60% of AI-written formal specs prove the wrong property — basedjensen · 2026-10-26
- Devin launches Security suite powered by Claude Mythos with $100M+ credits — DevinAI · 2026-10-26
- HackBench injects reward hacks into agent trajectories to stress-test monitors — DanielKhashabi · 2026-10-26
- Hugging Face ships hf CLI updates: deduped cache saves 19GB, faster buckets, retryable GPU jobs — yb2698 · 2026-10-26