Let the agents review the code

Code reviews are important

They are also boring and time-consuming. This point of view will resonate with many senior engineers and managers.

When I first started working somewhere with mandatory code reviews before merge, it was a revelation. We had been talking about doing this for years, I thought, and here we were doing it on every pull request. I am in no doubt that it improves code quality and catches bugs before they become issues. The challenge is that reviews block development flow, both of the code being reviewed and of the code the reviewer would otherwise have been working on. I have seen code sit for weeks awaiting review, and features miss their date because the developer had to go and review someone else's code. Neither is great, and it's a tough choice what developers should focus on.

Agents make the backlog worse

Coding agents got genuinely good at writing code during 2025, and the first instinct was to treat their output like outsourced code: hand it to a senior engineer for review. That worked for a while. It doesn't scale.

AI agents write code like enthusiastic mid-level engineers. Competent, often impressive, occasionally brilliant, but not always as good as it could be, and reliably faster than any human can keep up with. A single agent can produce in an afternoon what would take a developer a week. The review queue builds up fast, and senior engineers' time and attention are finite. Something has to give.

Agents can review too

Fortunately, there is now an alternative. In 2025 the frontier models got good enough at writing code to be the primary developers in some forward-looking organisations, and by early 2026 the open-weight models could do the same. It's not always perfect, but then neither is any human engineer.

If AI agents can write code as well as a mid-level engineer, it's reasonable that they can review it just as well, and with the right prompts they can review more like a senior engineer. They may not have the full context that a principal has, but even that can be fixed with the right prompts. The great thing is that an agent reviewer sits on its own. It doesn't block anyone else's work, and it runs in minutes on every single pull request.

Focused reviews, in parallel

A single generalist reviewer, human or AI, tends to miss things. When you're holding security, performance and architectural consistency in your head at once, each gets less attention than it deserves. AI agents are best when they're given clear, specific instructions, so we run several reviews in parallel, each with a focused prompt. As of writing, every pull request gets four:

  • General code review: correctness, clarity, obvious bugs, and our coding standards
  • Security review: thinking like a penetration tester, looking for vulnerabilities
  • Performance review: potential bottlenecks, inefficient queries, resource waste
  • Architecture review: structural problems, coupling, drift from established patterns

It's easy to add more, but running agents at scale has a real cost, so each new reviewer has to earn its place. The signal has to be worth the noise and the bill. You don't have to write every prompt yourself either: others have published prompts for specific use cases, as is the spirit of open source.

Use a different model

One strong preference: run the reviews on a different model from the one that wrote the code. A model reviewing its own output is too familiar with its own reasoning and too likely to approve its own choices. A different model brings fresh eyes. Ours run on lower-cost open-weight models, which keeps the bill manageable without giving up much quality.

Run it every time

The GitHub Action I use is open source: github.com/nickwhiteley/pr-reviewer. A PR-REVIEW.md file in your repository tells it about the project and which reviews to run. It posts its findings as comments on the exact lines they refer to, and it checks the serious ones a second time before they're allowed to block a merge.

None of this replaces human review, which is still important. But automating reviews takes the pressure off, and it often catches things people miss. The world is about to have far more code in production than ever before, written faster and by fewer people. The answer isn't less rigorous review. It's more systematic review: AI reviewing AI, in parallel, on every pull request.

← All posts