How to review AI-generated code

By Rogier Muller10.30.26
How to review AI-generated code

A pull request written by an agent is ready for review when a person can explain the diff without replaying the chat. We teach that as the Review step of Delegate, Review, Own. The agent may inspect and explain. The person who merges owns the change.

This note is the working order we use in a workshop on the team's own repository. The paste-in form lives in AI code review with receipts. The method itself is the methodology.

Read the diff before the explanation

Open the diff first. Read the files the way you would read a colleague's change: what moved, what the tests cover, and which lines you cannot explain. The chat is a commentary. It is not the change.

If the diff is longer than you can hold in one sitting, stop. Send it back with a smaller task. A missing test, a small validation change, or one helper extracted without a behaviour change is a reviewable unit. A request to improve a whole area produces a diff nobody can review before the context is gone.

Write down, in a sentence, what you believe the change does. If you cannot, the review has not started. Ask the author, or the agent, to restate the task in the pull request and to point at the lines that do that work.

Rolling this out in your team?

We train engineering teams on their own codebase in two days. Agent setup, shared rules and review included.

Write what was checked on the pull request

After the diff, record what was actually checked. The note names the files, the checks that ran, the risks that remain, and the decision a person still has to make. A confident paragraph with no file path and no test result is not enough to merge.

We ask for four lines, in the team's own words:

  1. What changed, as file paths.
  2. What was inspected: a test result, or a sentence on why the test could not run.
  3. What could not be proved.
  4. What a person still owns before merge.

The receipt article has a fuller form for teams that want one template. Use that form when the team has agreed it. A short note with those four facts is enough to start. Put it on the pull request, where the next reviewer can read it without the session.

Automated comments can point at a line. They do not replace the note, and they do not replace the merge. The person who approves the change owns requirements fit, design, and the verification of each finding.

Keep the task small enough for one sitting

The review fails when the task was unbounded. Before the agent starts, name the files it may touch and the commands it may run. If the diff leaves those files, the change is not ready. Send it back with the boundary restated.

That boundary is the same idea as data boundaries and human approvals. Review is where you notice the boundary was crossed. The approval is the merge, and any step that writes to a system outside the repository.

New dependencies need a person to accept them. A library the agent added because it was convenient is a product decision, not a formatting change. Security-sensitive code stays with a person. Architecture, production risk and business logic stay with a person. The agent can draft. The person decides.

Leave architecture and security with a person

Delegate, Review, Own is the order. Delegate means the agent does a whole task and a person reviews every change. Review means the evidence is on the pull request. Own means a named person can explain the result and is accountable for it.

In the team proficiency matrix, Delegated is the second level: an agent does a whole task, and a person reviews every change. Systematic is the next level: one shared workflow in the repository, so the review rule is not a private habit. Training starts from the level three in four people have reached, and aims one level up. A review rule that only one person follows is still Assisted, even if the diff looks tidy.

Use the same bar for Claude Code, Cursor and Codex. The tools differ in where the agent runs. The team rule does not. A person names the task and the boundary, the instructions live in the repository, and a person reviews the change before merge. Shared standards for Claude Code, Cursor and Codex is the rollout of that rule.

Use the same bar on every tool

Write the agreement where the agent will read it. AGENTS.md, a project instruction file, or a short team note is enough when it says which work may be delegated, what evidence must come back, and who owns the merge. Keep it short enough that people will maintain it.

Say what must be true before review: a diff, a test result or an explanation of why the test could not run, and a note of remaining risk. Pilot the written rules on one repository before you copy them. Track which review comments the team accepts and which it dismisses. Extend the standard only when that pilot is boring and repeatable.

In the room, we run this on a real pull request from the team's codebase, with tools the team has already approved. The session is under NDA. Code and data stay in the team's systems. A standard workshop is two days. A narrower scope can be one day. A group is ten to thirty people, with a minimum of eight. Larger organisations train in successive groups of up to thirty.

The first month of Pulse is included with a workshop. Pulse is a shared Slack or Teams channel with both founders, a first response within two business days, a written briefing every two weeks, and a two-hour live session each month for up to ten engineers. Each briefing item carries one recommendation: adopt, test or ignore. That is where a review rule gets corrected after the two days, on the pull requests the team actually opens.

Frequently asked questions

What should an AI code review record?

A short note on the pull request: what changed, what the review inspected, what it could not prove, and what a person still owns before merge.

Can an agent approve its own change?

No. The agent may inspect and explain. The team still owns the merge.

Where does this sit in the method?

It is the Review step of Delegate, Review, Own. The agent works inside a boundary. A person checks the evidence and decides the merge.

If you want this practised on your repository, book a 30-minute call. The engagement starts there, then the matrix, a stakeholder call, a written proposal, acceptance and scheduling, and bespoke training on your codebase.

Related research

Train your team on coding agents

Two days on your team's own repository, onsite or remote, with a written proposal before you commit.

Book a call

Prefer to measure first? Take the free team check.