If you give an LLM an ambiguous prompt, it will not ask for clarification.
It will hallucinate a speculative architecture, overwrite your working logic, and confidently tell you the task is done.
If you are a vibe coder, I’m sure you’d have come across the above.
Well, It was not recently diagnosed exactly why this happens. But, to fix this the former Tesla AI Director identified specific behavioral failures that make models like Claude Code self-destruct in production codebases
Wrong assumptions,
scope creep,
over-engineering,
and weak success criteria.
And well, a developer took Karpathy’s observations and distilled them into a single CLAUDE.md file that recently hit over 40,000 installs in a week.
When I was structuring the data ingestion pipelines for BoutPredict, I fought this exact friction constantly.
I would ask the agent to patch a simple parsing error in Python, and it would silently refactor three unrelated modules just to look clever.
This is not engineering.
It is babysitting.
Vibe coding, basically prompting an AI and blindly accepting whatever it spits out is a dead end.
We are shifting into agentic engineering, where the human owns the strict architectural boundaries and the AI handles the syntax.
So, what are the “Karpathy Rules” you need to hardcode into your project’s CLAUDE.md file to force your AI to act like a precision tool.
Think Before Coding (The Assumption Checkpoint)
The default behavior of an LLM is to fill knowledge gaps with plausible guesses. If you do not explicitly forbid this, the model will start writing code before it actually understands the problem.
The fix is that you must force the agent to pause and state its assumptions.
The Instruction:
“Before implementing any logic, state your assumptions explicitly. If multiple interpretations exist, present them. Do not pick silently. If a simpler approach exists, say so. If something is unclear, stop and ask.”
This breaks the confident guessing loop. It forces the agent to verify the architecture with you before it burns tokens writing syntax you will ultimately have to delete.
Simplicity First (Killing Speculative Features)
Agents love to over-engineer trivial tasks. You ask for a single database query, and the agent implements a bloated strategy pattern with flexible configurability that you did not ask for. Complexity is a liability.
The Instruction:
“Implement the minimum code that solves the specific problem. No features beyond what was asked. No abstractions for single-use code. No error handling for impossible scenarios. If you write 200 lines and it could be 50, rewrite it.”
If a feature or abstraction is not strictly required for the immediate task, it does not get committed to the codebase.
Surgical Changes (Strict Scope Control)
This is the most destructive failure mode in autonomous coding. You ask Claude to fix a bug, and it randomly reformats your comments, “improves” adjacent code, and alters your type hints. One diff should equal one scope.
The Instruction:
“Touch only what you must. Clean up only your own mess. Do not ‘improve’ adjacent code, comments, or formatting. Match existing style, even if you would do it differently. Every changed line must trace directly back to the requested task.”
If the agent notices dead code that is unrelated to the current prompt, it can mention it in a note, but it is strictly forbidden from deleting it.
Goal-Driven Execution (The Verification Loop)
If you ask an agent to “fix the bug,” it will guess the fix and immediately declare success without running the code. You have to transform tasks into verifiable criteria so the agent can loop independently until the problem is actually solved.
The Instruction:
“Define success criteria before coding. Loop until verified. ‘Add validation’ means ‘Write tests for invalid inputs, then make them pass.’ Do not declare a task complete until the verification step runs successfully.”
And we are good! :)
Prompting an AI and hoping it compiles is a reckless way to build software.
You can either spend your time manually reverting over-engineered code and hunting down drive-by refactoring bugs, or you can drop these four rules into your root directory today.
Stop treating the agent like a peer and start programming its constraints.
In case we are meeting for the first time, come over here, it’ll be worth the roller coaster of articles that are gonna come up in the next few weeks.
I swear tracking these updates is a job in itself, lately.
Here’s the list which I’ve built and keep adding on.
And If you need help for analyzing UFC fights, please check out BoutPredict :)