/Articles
Checklist: how to review AI-generated code
A short list of the things generated code gets wrong often enough to check every time.
Generated code is usually syntactically fine and locally plausible. That is the problem. A human writing something wrong tends to leave a mess you can see — a half-finished branch, a variable that makes no sense, a comment admitting defeat. A model writing something wrong leaves code that reads like it was written by someone who knew what they were doing.
So the usual review instinct — scan for things that look off — does not fire. Forty-five per cent of developers in the 2025 Stack Overflow survey named their top frustration as “AI solutions that are almost right, but not quite”. Almost right is the expensive kind of wrong, because it survives review.
This is the order we read a generated change in. It is ordered by how often each thing is actually wrong, not by how serious it would be.
Before you read a line: is this reviewable at all?
Teams with high AI adoption merge 98% more pull requests, and the pull requests are 154% larger (Faros AI, 2025). Review time rose 91%. The honest reading of those numbers is that a lot of code is now being approved rather than reviewed.
If a change is too big to hold in your head, nothing below will save you. Send it back and ask for it in pieces. This is not a courtesy to the reviewer; it is the only point at which the cost is still small. A reviewer who starts reading a 2,000-line change has already lost — they will get forty lines in, lose the thread, and approve.
The second question is whether the author can explain it. Not defend it — explain it. If the answer to “why is this retry here?” is a shrug, the change has no author, and you are the first person who will ever have read it.
The five-minute pass
1. Does it exist? Models invent methods, flags and config keys that ought to exist. The signature looks right, the name is what you would have called it, and it is not in the library. Check anything you do not personally recognise, especially on a dependency the team added recently.
2. Is it already in the codebase? The most common failure is not a bug, it is a duplicate. A new
formatCurrency, a second retry wrapper, a validation helper three modules from the one that
already does this. The model cannot see your repository the way you can, so it writes what the file
in front of it seems to need. Over a year this is how a codebase gets fat. Better
repository context reduces this; it does not remove
the need to check.
3. What does it do with the empty case? Zero rows, null, an empty string, a list of one. This is where “worked on the fixture, failed in production” lives. Generated code is written against the shape of the data it was shown, and your fixtures are tidier than your production table.
4. What does it do with the error? Look for the catch that logs and continues. A model asked to
make code robust will often make it silent instead, which is worse than a crash because you find out
in a month, from a customer. Check that a failure still fails.
5. Does it respect the thing enforced somewhere else? This is the one that costs the most and is hardest to automate. The invariant maintained by a different module. The ordering a caller depends on. The lock that has to be taken first. The column that is nullable in production but not in your schema file. Generated code is correct inside the file and ignorant outside it, and the bug is always outside it.
6. Did it add a dependency? A new import is a decision. Check that it is one the team would have made: licence, maintenance, size, and whether something already installed does the job.
What not to read for
Do not spend review attention on formatting, naming conventions, import order, obvious nulls, or style. If those matter, they belong in CI, where they run on every change for free and never get tired. A rule that lives in a reviewer’s memory is a rule that is enforced about half the time.
The same goes for secret scanning, licence checks and type errors. Every minute you spend on something a check could catch is a minute not spent on point 5, which no check can.
An AI reviewer can take the first pass here and is good at it. It should not be the thing that approves the change. There is a real psychological pull to a review agent that returns a column of green ticks, and it is the same pull that produced the approve-without-reading habit in the first place.
Tests deserve their own look
Generated tests have a specific failure mode: they assert what the code currently does rather than what it is supposed to do. They pass, coverage goes up, and the suite now locks in the bug.
Read a generated test by asking what change would make it fail. If the answer is “not much”, it is decoration. A test that would not have caught the bug the change is fixing is not a test of that change.
What to send back
Send it back when the change is too large to follow; when the author cannot explain a decision in it; when it duplicates something that exists; or when it is right but you cannot tell why it is right. That last one is the hardest to hold the line on and the most important. Code nobody understands is a liability whoever typed it, and it is the on-call engineer in eight months who pays.
Sending work back is not a judgement on the author. It is the only mechanism that keeps the cost of generated code attached to the moment it is generated, rather than deferred to an incident.
The uncomfortable part
In a randomised trial by METR, experienced developers working on their own repositories were 19% slower with AI tools — and believed they had been 20% faster. The gap between those two numbers is the whole reason to measure rather than estimate.
DORA’s 2025 report found AI adoption still has a negative relationship with delivery stability. None of this is an argument against using these tools. It is an argument against assuming they worked.
If you want to know whether your review process is holding, the numbers to watch are review time, pull request size, change failure rate and how long a change waits before someone looks at it. Take them now, change one thing, and read them again — how we measure adoption. Everything above is a hypothesis until you do.
The readiness check scores review alongside tools, testing, delivery, governance and skills. The policy template is the written version of who may accept a generated change. If your reviewers need a shared method, not only a checklist, that is the AI-Code Review Workshop.