-
Notifications
You must be signed in to change notification settings - Fork 0
KarpathyLLMCodingGuidelines
title: Karpathy LLM Coding Guidelines type: technique created: 2026-06-25 last_updated: 2026-06-25 related: ["radar/techniques/BuildingSkillsForClaude", "radar/techniques/StructuredPromptDrivenDevelopment"] sources: ["https://github.com/multica-ai/andrej-karpathy-skills"] radar_quadrant: Techniques radar_ring: Assess radar_position: inner
A single CLAUDE.md file encoding four behavioral guardrails against common LLM coding pitfalls, derived from Andrej Karpathy's observations. Distributed as a drop-in merge target for project CLAUDE.md files. 181k GitHub stars as of 2026-06-25.
1. Think Before Coding -- Surface assumptions before implementing. If multiple interpretations exist, present them rather than choosing silently. Stop and ask when something is unclear.
2. Simplicity First -- Minimum code that solves the problem. No unrequested features, abstractions, configurability, or error handling for impossible scenarios. If 200 lines could be 50, rewrite.
3. Surgical Changes -- Touch only what the request requires. Do not improve adjacent code, refactor working code, or clean up pre-existing dead code. Every changed line must trace directly to the user's request.
4. Goal-Driven Execution -- Transform tasks into verifiable goals. Define success criteria before starting. For multi-step tasks, state a brief plan with per-step verification checks.
The file is explicitly a behavioral override that biases toward caution over speed. It targets the characteristic failure modes of LLM-assisted coding: over-engineering, silent assumption-making, scope creep, and unverified completion. The tradeoff is acknowledged -- for trivial tasks, judgment overrides the guidelines.
The file is designed to merge with project-specific CLAUDE.md instructions rather than replace them.
Placed in Assess at inner position. The four principles are well-scoped and directly address the most common failure patterns observed in LLM-assisted coding. The 181k star count reflects genuine adoption. The principles overlap with radar/techniques/BuildingSkillsForClaude (behavioral instruction writing) and radar/techniques/StructuredPromptDrivenDevelopment (prompt discipline). Trial gate: merge the file into an active project CLAUDE.md and measure whether over-engineering and silent assumption incidents decrease across a sprint.