karpathy-coding-discipline
Drop into CLAUDE.md/AGENTS.md as the first behavior norm a coding agent ingrains — think before coding, prefer the simplest solution, change only what you own, and execute toward the stated goal.
- Score
- 99.9772 signals
- Evidence
- 209,417 stars · 21,315 forks
- Last commit
- as last read from GitHub; most reads are from 2 Sep 2026 or later
- Listed
Install
armory install karpathy-coding-discipline --cli claudewrites the file to.claude/rules/karpathy-coding-discipline.mdListed as compatible
# fetches the source and writes it to:
.claude/rules/karpathy-coding-discipline.mdNeeds the armory CLI · not on npm yet, build it from cli/ in the repository
What it is
THE FOUR THINGS — a four-clause behavioral constitution for any coding agent, distilled from Andrej Karpathy's working style. (1) Think Before Coding: state the plan and the assumptions first. (2) Simplicity First: the simplest solution that works wins; don't gold-plate. (3) Surgical Changes: touch only the files you own; never reformat or "improve" neighbors. (4) Goal-Driven Execution: every action moves toward the stated goal, and you verify the goal is met before declaring done.
When to use it
Make this the FIRST rule in any agent harness — it is the constitution that governs every other rule. Reach for it whenever an agent is over-engineering, sprawling across files it doesn't own, or shipping without verifying.
How to install / invoke
armory install karpathy-coding-discipline places the repository's own rules file,
https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md, in your harness's rules folder
(.claude/rules/ for Claude Code). Or paste the four clauses near the top of your CLAUDE.md (or AGENTS.md).
Reference it from every worker mission so sub-agents inherit it. The four clauses are short enough to quote verbatim
in a system prompt.
Notes
This is the behavior-norm layer, not a linter — it shapes how the agent decides, not what the code looks like.
Pairs with socratic-thinking (debate before building) and test-before-build (verify the goal as a user).
Related
Not Indexed
- socratic-thinking
- simplicity-first
- surgical-changes
- goal-driven-execution