Four rules with a borrowed name
Early in 2026 a short file started circulating under names like “Karpathy rules” or “the Karpathy way”: four principles to put in a CLAUDE.md so that coding agents make fewer mistakes. Its GitHub repository has gathered more than 230,000 stars.
Andrej Karpathy did not write it. On January 26, 2026 he posted a long set of notes on X about the weeks he had spent coding with agents. The next day a developer turned the problems described in that post into four rules and published them, stating clearly that they were derived from Karpathy’s observations. The name stuck to the rules; the observations behind them travelled less.
What Karpathy actually observed
His starting point was a personal shift. In November 2025 he estimated his coding as roughly 80% manual work and autocomplete and 20% agents; by December the ratio had flipped. He described it as programming mostly in English and called it the biggest change to his workflow in about two decades.
He was just as clear about the weaknesses. The mistakes, he wrote, are no longer syntax errors but subtle conceptual errors of the kind a hasty junior developer might make. The most common: the model makes an assumption on your behalf and keeps going without checking it. It does not say when it is confused, does not ask, does not point out inconsistencies or present tradeoffs, does not push back, and is still somewhat sycophantic.
Two more patterns stood out. Models overcomplicate code and APIs, add abstractions and leave dead code behind; his example was a brittle solution of around a thousand lines that shrank to about a hundred once he asked whether there was a simpler way. And they sometimes change or remove code and comments unrelated to the task. All of this, he noted, persisted despite instructions in CLAUDE.md, and yet he could hardly imagine going back. His advice for code you care about: watch the agent like a hawk.
How the four rules map to those problems
Think before coding: state assumptions, ask when something is unclear, show the possible interpretations and tradeoffs. This targets the silent assumptions and the unmanaged confusion.
Simplicity first: write the least code that solves the problem, with no speculative features or single-use abstractions. This targets the thousand-line solutions.
Surgical changes: touch only what the task requires and leave unrelated code alone. This targets the side-effect edits.
Goal-driven execution: turn the task into verifiable success criteria, such as tests, and loop until they pass. This one comes from a different part of the post, about leverage rather than mistakes.
What the rules leave out
The post is broader than four rules. On leverage, Karpathy’s point is that models are very good at looping until they meet a specific goal, so it pays to give them success criteria instead of step-by-step instructions: have them write the tests first, or write a simple, almost certainly correct version and ask for an optimised one that keeps it correct.
On speed, he argued the effect is less a speed-up of what he would have done anyway and more an expansion: he builds things that were not worth building before and works in areas he previously could not.
On skills, he noticed his ability to write code by hand starting to atrophy, while reading and judging code holds up, because writing and reviewing are different abilities. And he warned about a flood of low-quality generated content, the “slopacolypse”, alongside real gains.
From vibe coding to watching like a hawk
In February 2025 Karpathy coined “vibe coding”: accept every change, stop reading the diffs, paste errors back in and let the code grow beyond your understanding. He framed it as fine for throwaway weekend projects.
The January 2026 notes are not a contradiction but the other end of the same spectrum. For code that does not matter, give in to the vibes; for code that does, keep it in view, review it and give the agent the rules and the goals that keep it on track.
My take
Starting with a plan, asking questions and brainstorming can feel slower. But for the result to come out exactly as we want, I think the “think first, plan first” part is the most important one.
After that comes surgical changes. That is what keeps the AI from getting out of control. Otherwise, as the change grows, new problems appear; as you solve them, newer ones can appear, and the AI dives into a bottomless pit.
On atrophy I agree with Karpathy: we can review code even if we no longer write it. But as AI tools have improved, the balance of supply and demand has changed too. Much more complex code is now written much faster, and that strains people’s ability to understand and trace it. At some point the conversation turns into “let the AI write it, let the AI review it, let the AI test it.” I wrote about how this looked in our team in “Speed came, learning dropped”.