A second reviewer: fresh context, another model, and a sceptical read
By the end of this lesson you will have a review of your last two commits written by a reviewer that never saw them being made, a verdict next to each of its findings — real, taste, or wrong — and a failing test for every finding you called real, written before its fix.
The idea
The session that wrote the code is the worst reviewer of it. It holds every assumption it made along the way, every file it decided not to open, and its own explanation of why the code is right. Asked to review, it reviews its explanation. A reviewer needs distance, and there are two kinds you can get cheaply.
Fresh context
The same agent with an empty memory of how the code came about. Three ways:
- The built-in review. In Claude Code,
/code-reviewreviews the changes on your branch in a subagent with its own context window, and posts its findings into your conversation when it finishes;/reviewis the same command. In Codex,/reviewdoes the same in a sub-agent that starts with an empty history, against a base branch, your uncommitted work or one commit, and posts its findings back;codex review --base mainruns it from your shell. /clear, in either agent, then ask for a review of the diff againstmain. The rules file is there again; the conversation that produced the code is not.- A second terminal with a new session, which is the same as
/clearwithout losing your first conversation.
Another model
A different model has different blind spots, which is the point. /model switches the model for the session in either agent. Or ask the other agent: both read the same AGENTS.md, so if you build with Claude Code, codex review --base main is a second opinion from another vendor's model, and the other way round. Use one second opinion, not five: past a point, more reviewers produce more noise than signal.
Read the critique sceptically
A review is a list of claims, delivered with the same confidence whether they are right or wrong. Treat each finding the way you treat generated code: as untrusted until shown.
finding → can I make it happen? ─ yes → real: write a failing test, then fix
└ no → is it about how the code reads?
├ yes → taste: decide, in one sentence
└ no → wrong: write down why, move on
A real finding is not always about behaviour. The most common one is a comment or a line of documentation that was true yesterday and is false after your change: you cannot write a failing test for a sentence. Fix the text, and write down in the notes why it was wrong. The same holds when two documents disagree with each other or with the code, for instance a line in PRODUCT.md about how rows may be ordered against the order your page now uses: decide which one says what you want, change the other, and note the decision.
A finding you cannot reproduce is not a finding yet. Ask the reviewer for the input that breaks the code; if it cannot name one, that tells you something about the finding.
Two habits keep this honest. Ask for evidence, not adjectives: a file, a line, an input, and what goes wrong — "this could be more robust" is not a finding. And one round, then you decide. Feeding the author's answer back to the reviewer, and the reviewer's answer back to the author, is a loop with no end, because each will happily find something more. You are the one who stops it.
Watch for the opposite failure too. Ask a reviewer "are you sure?" about a line that is correct, and it may apologise and find a problem that is not there. Agreement is cheap for a model. The test you can run decides, not the tone of the reply.
What a review cannot see
A reviewer reads the diff, not your intent. It can tell you that sortByMove copies the array; it cannot tell you that you wanted ties broken by ticker. That is what the rules file and PLAN.md are for — point the reviewer at them, and findings come back measured against your standard instead of a generic one.
Try it now
The prompt
With lessons 4 and 5 committed, start a new session in the starter folder and paste:
Review the last two commits against AGENTS.md and PLAN.md. List at most
five findings. For each: the file and line, what goes wrong, and an input
or a sequence of steps that makes it go wrong. Do not change any file.
Or use the built-in review — /code-review in Claude Code, /review in Codex — and read what it posts.
What the agent should do
- Read the diff, the rules file and the plan, and change nothing.
- Return no more than five findings, each with a location and a way to make it happen.
- Say plainly if it found nothing that breaks, rather than inventing a finding to fill the list.
Check it yourself
- Every finding names a file and a line. A finding without one goes back with "where?".
- Next to each, write real, taste or wrong, with one sentence of reason, in a new file
notes/review-1.md. - For each real one, ask the agent for a test that fails because of it, and see it fail before any fix.
- Fix, run
npm test, and see it pass. - For each wrong one, your sentence says what the reviewer missed.
Break it on purpose
Plant a bug and see whether the reviewer finds it: on a new branch, change sortByMove to sort by change_p instead of its absolute value, and commit it with an innocent message. Run the review again. Then, on a line that is correct, ask "are you sure this is right?" and watch how firmly it holds. Afterwards git switch main and delete the branch with git branch -D. You now know how much this reviewer's silence is worth, and how much its doubt is.
Compare with ours
How our review notes look
src/lib/move.ts:6 — sorts by size only; a +3 and a -3 tie, and tie order is the
watchlist's. TASTE: intended, and a test already pins it.
src/app/page.tsx:45 — a row with no change_p would sort as NaN. WRONG: quotes()
drops rows whose change_p is not a number before they reach the page.
tests/move.test.ts — no test that the sort is stable for three or more equal
moves. REAL: test added, red on a hand-written unstable sort, green on ours.
The line numbers are those of our files. In yours the same line may sit a few lines higher or lower — in page.tsx, it is the one that hands sortByMove(rows) to the table — so match a finding by what the line does, not by its number. The notes are on the branch ref/work-with-an-agent/6 of the starter repository, as notes/review-1.md.
Checkpoint
npm test # green, with the tests for your real findings
git status # notes/review-1.md, your new tests and fixes, and no .env*
git add -A
git commit -m "review: test for each real finding, notes for the rest"
Then answer this lesson's questions.