Aglio blog

November 13, 2026 · Aglio team · 3 min read

Reviewing code an agent wrote

Read the work log before the diff, treat evidence as a claim to verify, and keep the reviewer separate from the builder. A practical review routine for agent pull requests.

Reviewing code an agent wrote is not harder than reviewing code a colleague wrote. It is different. A colleague leaves context in your head: you know what they were on last week, what they tried first, which part they were unsure about. An agent leaves a diff and, if the process is honest, a record of how it got there.

The interesting question is not "did the model write good code". It is "what would I need to believe this change is safe". Aglio tries to put that material on the card before the pull request lands.

Read the work log first, not the diff

A diff shows the destination. The work log shows the route: what was tried, what failed, what was assumed, what was skipped. Reading the log first tells you where to look in the diff. Skip it and you review twenty files evenly, when three of them carry all the risk.

A change that arrived after two dead ends deserves more scrutiny than one that went straight through. The agent rewrote something twice, so the second rewrite may still carry the shape of the first.

Check the claim against the proof

"I added tests and they pass" is a sentence. Evidence is a test name, a command, an exit code recorded on the card, a lint run, a build that finished. Aglio will not let a run declare itself done without verification evidence, which mostly removes the most boring failure mode: code that compiles, ships, and breaks the first time someone hits the boundary.

Treat evidence as a claim to verify, not a verdict. Green tests that assert nothing are still green tests.

Separate the builder from the reviewer

One model reviewing its own work is a formality. The reviewer agent runs separately from the builder, with its own prompt and its own view of the pull request, and the project can set a default reviewer or pick one per review. It is still not a human. Its value is that it has not spent the whole run convincing itself the code is right.

Look for the shape of the change

Agents are good at local correctness and bad at noticing that the local fix contradicts the surrounding design. Ask:

  • Does this reuse the existing wrapper, or did it invent a parallel one?
  • Is the new state in the same place as the old state, or is there now a second source of truth?
  • Did error handling follow the pattern in the neighbouring files?
  • Are the tests testing behaviour, or the implementation that happens to exist today?

None of these are style opinions. They are the reasons a change becomes expensive six weeks later.

Watch the scope edges

The most common agent mistake is quiet generosity: fixing an unrelated typo, renaming a parameter, deleting an import it thinks is unused, adding a helpful abstraction. Left unchecked, a focused card turns into a review of three unrelated decisions. The card's non-goals exist to make that visible and reversible.

Feedback should resume the run, not restart it

A review comment that starts a fresh agent loses everything the previous one learned. Failing checks and review feedback move the card back to Doing and resume the same session, so the agent keeps its context while it fixes the problem it understands. You get a second attempt, not a second guess.

Review spend like you review code

Every run has a cost, and the card shows it. A change that cost four times the estimate usually means the spec was thin or the run wandered. That is a spec problem, and it belongs in the retro alongside the code comments.

Humans still merge

The agent opens the pull request and records the evidence. It does not merge. That boundary is not decoration: it is the point where a machine-produced proposal becomes your codebase's history, and someone accountable should be the one to make that call.

Review like the author is competent, fast, tireless, and completely unaware of your conventions. That is exactly the case.