Clean Code's Author Stopped Reading AI Code
Robert C. Martin no longer reads code his AI agents write. He fences them in with tests and metrics instead. What that shift means for teams buying software.
For Business

On this page
Robert C. Martin, the author of Clean Code, says he no longer reads code written by his AI agents. He replaces reading with constraints: unit tests, acceptance tests, mutation testing, coverage, complexity and dependency checks. Clean code did not die with that decision. It moved from the reviewer's eyes into the gate the code must pass.
The person who taught a generation of developers that code is read far more often than it is written now says he skips the reading. That sounds like a reversal. Look closer and it is the same discipline, enforced by machines instead of by a tired human at 4 p.m.
What did Uncle Bob actually say?
The debate surfaced in April 2026, when Martin wrote that he does not review agent code and instead measures "test coverage, dependency structure, cyclomatic complexity, module sizes, mutation testing". On 23 July 2026 he restated it in a post on X that drew around 15,000 likes: he started coding in the late 1960s, and his current strategy is to read none of the code his agents write, because that is the only way to get their productivity.
His reasoning, as reported by Startup Fortune: humans are slow at code, so to get productivity they have to step back and manage from a higher level. In the same thread he admitted that two years earlier he did not believe AI would become this capable.
The part that gets lost in the headlines is what he does instead.
What replaces reading the code?
A gauntlet. Every change an agent makes has to survive a stack of automated checks before Martin trusts it. The layers he has named:
- Unit tests, written by the agent.
- Gherkin acceptance tests: plain-language scenarios ("Given a guest has a booking, when they check out, then the room becomes dirty") that describe behavior. These are the part Martin still reads.
- Mutation testing: a tool deliberately breaks the code (flips
>to>=, deletes a line) and checks whether any test fails. A surviving mutation may reveal missing coverage, but it can also preserve the program’s behaviour. Review it before treating the score as proof of a weak test suite. - Coverage and the CRAP score: CRAP (Change Risk Anti-Patterns) combines how tangled a function is with how little of it is tested. High complexity plus low coverage is where bugs live.
- Cyclomatic complexity and module size limits: hard caps on how many branches a function may have and how big a file may grow.
- Dependency structure analysis: which module may depend on which, so the agent cannot quietly wire the database layer into the UI.
- QA procedures and periodic manual testing by Martin himself.
He is also candid that the full stack is not always worth it. Per ExplainX's summary of the thread, for much of his work he settles for unit tests plus the CRAP metric.
So is clean code dead?
No. The reader changed.
Martin's own explanation for the size and complexity limits is that messy code slows his agents down: he has watched them wrestle with their own mess without resolving it. An agent working in a 2,000-line file with tangled dependencies burns context, misses side effects and patches the same bug in three places. Small functions, clear names and enforced module boundaries can make an agent's work easier to inspect and complete.
So the rules from 2008 still apply. What changed is who enforces them. A reviewer used to catch a 200-line function by eye. Now a linter rejects it before anyone looks. The standard is the same; the enforcement is cheaper and it never gets tired.
Where does this approach fall short?
Grady Booch, co-creator of UML, answered Martin directly. Booch reviews everything his agents generate. His point: coverage and complexity numbers say the code does what the tests ask, but they give "no confidence whatsoever" that an agent has not introduced vulnerabilities, dead code, or a poor factoring that hurts performance later.
The research backs his worry. A July 2026 study of 4,022 pull requests from autonomous coding agents, Trust but Verify? Uncovering the Security Debt of Autonomous Coding Agents (accepted at a KDD 2026 workshop), found security smells in nearly two in five agent PRs. Hard-coded credentials made up 99.6% of critical-severity smells, and more than four in five credential leaks slipped past existing review.
None of Martin's gates looks for a leaked API key. Mutation testing does not care that a password sits in a config file. A test suite can be green while the repository hands an attacker the keys. That gap needs its own gate.
The second limit is less technical. Martin has written software for nearly six decades. He knows which constraints matter because he has seen what goes wrong without them. A team that copies "don't read the code" without that judgment gets the speed and none of the safety.
What should a business buying software check?
If your vendor builds with AI agents, ask how code review and automated checks work together. Concretely:
- Can they show the acceptance scenarios? Gherkin or plain-language specs you can read and sign off. That is your contract with the code. If nobody can show you what behavior was specified, nobody verified it.
- Is there mutation testing, or at least a coverage floor that blocks merges? Coverage alone can be gamed with tests that assert nothing. Mutation testing probes test strength, but its result still depends on mutation types, exclusions, and scenario quality. A high score does not prove freedom from bugs or vulnerabilities.
- Are complexity and file-size limits enforced in CI, not just written in a style guide?
- Is there secret scanning and dependency auditing on every PR? These checks address leaked credentials and known dependency issues, but do not cover every security or design concern Booch raised. It ties directly to the governance gaps covered in why AI coding pilots stall.
- Who reads security-sensitive changes? Authentication, payments, permission checks. A reasonable split: let metrics gate routine code, keep a human on the paths where one mistake is expensive, as with idempotent payment APIs.
- Do you get the tests at handover? The checks should come with the codebase so future maintainers can run and update them. Put the test suite and CI config in the handover checklist.
The same thinking applies to products that call an LLM at runtime, where you also cannot read every output and need evals instead of assertions.
The takeaway
Martin did not abandon clean code. He stopped being its only enforcer. For a small team, that is good news: the checks that used to depend on a senior engineer's attention can run on every commit. The catch is that someone has to design the gauntlet, and someone has to cover what it cannot see. That someone is still a person who reads code.
Related Posts
Need help applying this approach?
System Architecture Consulting
Map requirements, integrations, and risks before building or expanding a system. Get design options and priorities to discuss with your team.
Explore related servicesDescribe the operational problem you are facing so we can discuss a suitable next step.