writing2026-11-02
How I review code an AI agent wrote
5 min readAI, Process, Code review
AI code review the other way round: the loop I use to review what an agent writes, with real pull requests from this site, a missed criterion and a closed PR.

Most writing about AI code review is about tools that review your code for you. This post is about the other direction: me reviewing code that an AI agent wrote.
It matters to me because the first version of this site failed exactly there. I let an agent write code faster than I could read it, and when something looked wrong I could no longer tell which change had caused it. I archived it and started again with a rule I still follow. The story of the rebuild covers the stack and the design. This post covers the review loop that kept the second attempt under control.
One story, one branch, one pull request
Every change starts as a Jira story with three to six acceptance criteria. The criteria are written before any code, and any decision the story depends on is made then too. The agent gets one branch for the story and opens one pull request. The criteria become the review checklist.
That last part is the whole trick. "Review this" is vague, and vague review is where AI-generated code slips through, because the code usually looks reasonable. "Does the home page's first-load JavaScript drop by at least 45 KB?" has an answer.
The pull request has to show, for each criterion, how it was checked. Ticked with the evidence, or left unticked with the reason. If a criterion can't be met, the PR says so instead of merging around it.
Small pull requests, reviewed before they open
Since the restart on 25 August, 153 pull requests have been merged and 6 were closed without merging. Leaving out release and merge-back PRs, the median one changes 246 lines, and half of them change between 91 and 514.

The chart isn't the steady line I expected to draw. The first week has 64 merges, most of them small single-story PRs for the contact form and the site shell. The September gap is the board waiting on me: by mid-September eleven stories were blocked on decisions only I could make, like the home page copy. The October spike is the pre-launch review and the release.
The median PR was merged less than 20 minutes after it opened, which looks like rubber-stamping. It isn't, because the review mostly happens before the PR exists. While the agent works, I watch the session, answer its questions and read the diff as it lands. By the time the PR opens, it's a record of what was checked rather than the start of the conversation.
Size is what makes that possible. Google's code review guide says small changes are "reviewed more quickly" and "reviewed more thoroughly", and with an agent it's even more true. A 250-line diff I can hold in my head. A 3,000-line diff from an afternoon of "keep going" I can only skim, and skimming is how the first site failed.
What I actually check
The acceptance criteria come first. After that, these are the questions that catch the most:
- Did it reproduce the result, or describe it? "Passes the build" means the build ran. A layout claim means a screenshot at 390 and 1440 pixels in both themes. An accessibility claim means reading the accessibility tree, not the JSX.
- Is anything invented? An agent fills gaps confidently. A stub CV, a placeholder blog post, a client name, a number nobody measured. The project's
CLAUDE.mdforbids all of these by name, and I still check. - Did the scope grow? Adjacent work is fine to notice and wrong to do inside the story. It goes on a ticket instead.
- Are the numbers measured, and measured fairly? More on this one below.
- Will I understand this in three months? Clear names, small functions and almost no comments. The source of this site has comments on about 0.1% of lines, and each one explains a business rule or a non-obvious constraint.
When the agent says it's done
The examples that taught me most are the ones where "done" needed a second look.
A criterion that was missed by 1.6 KB. One story asked for at least 45 KB less JavaScript on the home page. The change removed an animation library and loaded the search palette on demand, and the measured drop was 43.4 KB. The pull request left that criterion unticked, explained that the remaining code is a dialog the mobile menu also needs, and listed the before and after numbers. I merged it knowing exactly what I was accepting. A PR that rounded 43.4 up to "about 45" would have been easier to merge and worse.
A trade-off that wasn't worth it. Another story tried to make the home page paint sooner by inlining the stylesheet. It worked, and the main text appeared about 0.7 seconds sooner on a throttled phone. It also made every page heavier and relied on an experimental framework flag, and the site already met its performance target. I closed it. It's one of six PRs closed unmerged, and those six taught me as much as the 153.
A measurement that blamed the wrong thing. In that same PR, the first draft reported that inlining made the page about 110 milliseconds slower to respond. The comparison was against a test run from a faster CI machine. A third run, on a change that didn't touch those pages, showed the same slowdown everywhere, so most of it was the machine. Against a comparable run, the real cost was about 30 milliseconds. The agent caught it and corrected the PR, but only because the rule is to compare against a fair baseline rather than the nearest number.
What per-PR review doesn't catch
Reviewing each change well isn't the same as reviewing the product. Two things only showed up when I stepped back.
The first design direction was built across many well-reviewed pull requests before I replaced it with the grid layout the site uses now, and most of those pages were rebuilt. No acceptance criterion would have caught that, because the problem was the direction, not the code.
So before the launch, I went through every page myself, with no story driving it. That one review turned into nine new stories: the navigation, the home copy, the experience timeline, the project filters, mobile spacing and more. Stories merge as they are during the build, and a deliberate review at the end catches what the pieces hide.
Decisions get the same treatment. Each one goes into a Decision Log with what was decided, why, and what it cost. The ideas I've rejected, like analytics on this site, sit in a list in the project's CLAUDE.md with an instruction not to propose them again without new information, so they don't get re-argued every session.
If you're starting to review AI-generated code
- Write the acceptance criteria before the agent writes code. They are the review.
- Keep each change small enough to read in one sitting.
- Ask for evidence, not claims. A screenshot, a number, a test, a link.
- Treat "I couldn't meet this" as a good outcome. It's what an honest PR looks like.
- Close the PRs that aren't worth merging. Closing is part of reviewing.
- Step back before you ship, and review the product, not just the diffs.
Google's reviewer guide puts the bar well: approve a change "once it is in a state where it definitely improves the overall code health of the system being worked on, even if the CL isn't perfect." That holds whether a person or an agent wrote it. The difference with an agent is how fast the changes arrive, so the loop has to be built for that speed.
If you want to see the tools behind this loop, the Claude Code setup post covers them.