AI-written code review: 5 checks
An agent’s diff can pass its tests and still break things: five checks a fresh session runs, then APPROVE or CHANGES.
- Posted
- Works in
- Claude Code, Codex
- Topics
- Review
FreePro skills, $15 for 30 days
- Source
- Original
Review the diff on this branch against main. You didn't write it. I want a review, not fixes: change nothing.
Start with only the diff's file list, the changed function names and the commit messages, not the code itself. Write down the inputs you would test, edge cases included. Then open the code and run those inputs.
Answer these five, in order, with the file and line for each finding:
1. Tests: list every test the diff adds or changes. Run them against main's code and say which fail there. A new test that also passes on main proves nothing about this change.
2. Blast radius: every function the diff changes, who calls it, and what else could break. Mark anything that touches an interface, stored data or a shared dependency.
3. Unrun claims: anything a commit message, comment or the PR text says works, is tested or is fixed that no command in this review showed. Run what you can, and list what stayed unrun.
4. Deleted code: every removed function, check, test, branch or config line, and whether something else still does its job.
5. Size: lines changed and files touched. If it is over 400 lines or mixes unrelated changes, say how to split it and stop there.
Then run the full test suite on main and on this branch and compare the results, even if both are green.
End with APPROVE or CHANGES, the findings ranked by how bad they are, and what you couldn't check.## Before I merge an agent's diff
- [ ] The new tests fail on main and pass on the branch.
- [ ] I know who calls each changed function, and nothing that touches stored data, an interface or a shared dependency surprised me.
- [ ] Every "works", "tested" or "fixed" in the PR has a command and its output behind it.
- [ ] I read every deleted line, and whatever it did is still done somewhere.
- [ ] The diff is under 400 lines and does one thing; otherwise it goes back to be split.
- [ ] A fresh session reviewed it, and every fix after that review was reviewed again.Use it
Send it to a new Claude Code or Codex session on the branch with the diff.
A session that helped write a change shares its blind spots. Send this prompt to a fresh session that knows only the repo.
It lists the inputs it will try before opening the code, then runs them, so the edge cases aren’t shaped by the code they test. The list below holds the same five checks for when you read the diff yourself.
Adapted from a Tomas Vykruta post: in his tests, fresh reviewers that executed the change caught bugs the agent that wrote it had missed.
