Review a change before you merge

Say what a change was for, read it as one page with the tests that moved with it, let the review judge it against what it was for, and post only what you approve.

8 min read · Video walkthrough

Before you start

  • A Git repository open in WTFCode.
  • For pull requests: a GitHub sign-in under Settings → GitHub. A GITHUB_TOKEN or GH_TOKEN in your environment, or a signed-in gh, works too.
  • Optional: a model under Settings → AI. Without one you read the page and write requirements by hand, and every check on them still runs. With one, an agent drafts requirements, and the review gives each a verdict and drafts comments and a summary.
In 29 seconds: PR #12 adds a bulk discount to a sample checkout app, from the pull request list through its diff and tests to the posting confirmation. The GitHub account and model responses are simulated.

Open a change#

Open Code Review from the left rail, or press ⌘⌥R. The rail icon carries the number of files you’ve changed. Pick what to review in the header:

To reviewChoose
A pull requestThe Pull requests tab, then its title. The range runs from its base to its head, with no fetch when the commits are already local.
A branch or commitsTwo refs, such as main → feature or HEAD~1 → HEAD.
Your own editsHEAD → Working tree (uncommitted): the fastest way to check what an agent just wrote.
The Pull requests tab lists Bulk discount code, PR #12, with a Your review badge.
Choose Bulk discount code to review PR #12.

Needs my review narrows the list to the pull requests waiting on you. The filter box takes GitHub’s own search words, such as is:closed author:kim.

Say what it was for#

A review that only reads code can say a line looks risky. It can’t say whether the change does what it was for, because the diff doesn’t say what it was for. That is where agent-written code goes wrong: it compiles, its own tests pass, and nobody checked it against the ask. So before the first review of a range, Code Review asks what the change must do.

The corner shop’s last commit adds a BULK20 discount. A short description becomes the source, one requirement is written as a before and after, “it works” is flagged until it names a result, and the review opens with the requirement first. Recorded with AI off.
  1. Open the Requirements step.

    The page’s first part, What it should do, says when a range has none yet. Choose Write requirements there. Pressing Review does the same the first time you review a range. The step, What should this change do?, has the requirements agent’s chat on the left and the list on the right.

  2. Add where the intent is written.

    Under Written from, choose Add and pick a source. A short description is enough: “BULK20 takes 20% off orders of 10 items or more.”

  3. Add a requirement.

    Choose Add a requirement, give it a title, fill in its four parts and pick its kind. The Before and after picture above the list redraws as you type.

  4. Fix what’s flagged.

    A note appears under any field that can’t be checked as written, and the footer counts them: “1 of 1 can’t be checked as written yet.” The note goes once the field says something checkable.

  5. Review against them.

    Choose Review against 1 requirement; the count follows your list. If the change really has no stated intent, choose Review without requirements, and WTFCode remembers that for the range.

What a requirement is made of#

One requirement is one behavior, in four parts, each written so a person or a test can look and say yes or no.

PartSaysExample
WhenThe situation: the input, the call, the screen.An order of 12 items uses BULK20
BeforeWhat the base code does there. A New requirement has none.The code is refused
AfterWhat must happen now, as a result a person can see.The total is 20% lower
How to check itA command, a test, or steps in the app, and what to look for.Run PricingTest

Its kind is Changed (before and after must differ), New (there is no before) or Kept: behavior near the change that must not move.

What gets flagged

Each requirement is checked as you write it. The check needs no model and gives the same answer every time.

FlaggedWrite instead
A part left emptyThe test to run, or the steps and what you’d see
An after that only says it’s right: “it works”, “as expected”“the total is 20% lower”
A comparison with no number: “faster”“under 200 ms for 1,000 rows”
A check that only says to check: “test it”“run PricingTest”
A Changed requirement whose before and after matchMake it Kept, or say what moved
An id that isn’t R and a number, or one used twiceR1, R2

Sources, and the agent that drafts#

SourceHow it’s read
A file of the folderA PRD, a spec, acceptance criteria, read as it is now, so edits to it count.
A short descriptionA few lines you write in the step.
The pull request’s descriptionRead from GitHub with your sign-in, only when you add it.
An AI sessionThe prompts of the Claude Code or Codex session that made the change, from Agent Replay’s recordings on your Mac. Often the most honest record of what was asked.

With a model chosen, the chat in the step is the requirements agent. It reads every source whole and the change as the page lays it out, then writes the list; the same checks run on what it writes.

  • It asks rather than invents. A behavior no source mentions becomes a question to you, one at a time.
  • It can’t start the review. Only your Review against N requirements does.
  • The list is yours. Edit anything; a confirmed list you change is a draft again until you confirm it.

Read the page#

A change opens as one page, with a bar on the left naming its parts. Nothing on it is computed by a model when it opens; it is read from Git and the index.

PartWhat it holds
What it should doThe requirements as a before and after, with their verdicts.
SummaryWhat the change does, seven numbers (files, lines added and removed, changes that need care, changes with no test, comments, minutes to read), and what the review says.
StoriesEach change in the order it asks for attention: why, what needs care, its code, its comments, the ways through it worth trying, and the tests that changed with it.
ChecksHow the static analyzers ran, and comments that belong to no story.
Also changedFiles nothing runs differently for: docs, formatting, config that isn’t read.
Next stepsFind bugs, draft review comments, judge the findings, run the tests that changed, commit.

Files changed, the second tab, is the same range as the raw diff with the comments under their lines. A file ticked as viewed stays ticked after a reload.

Check each change against its tests#

Choose a change in the index on the left. Under it, Tests that changed with it opens the test diff beside the new behavior. Read them together and ask what the tests don’t cover.

Code Review shows the new 20 percent discount branch and two test cases, one for a large order and one for a small order.
The price rule and its tests in the same story.

Run the review#

Review in the header runs the model’s review and the static analyzers in one click; the header says what it’s reading and offers Stop. With requirements confirmed, judging them is its first job, ahead of the open-ended search for other breaks.

VerdictMeans
MetThe diff does what the after says, with the lines that do it.
Not metIt doesn’t: the trigger, the lines it runs through, expected against actual, and how to prove it. It adds a blocking comment (R2 not met: …) and turns the drafted verdict into Request changes.
UnclearThe review couldn’t tell from the diff, or no part of it judged this one.

When it ends, the summary lists the model’s summary and every comment, each a row that jumps to it in place; the model’s are marked AI review. Select Summary to write or edit the overall note yourself. Select a requirement to see why it got its verdict. The before and after picture is drawn from your list by code, never by the model.

Prove it with a run#

A verdict is still a reading of code; a run settles it. Find bugs in Next steps starts a hunt that runs each requirement’s check first and records passed, failed or not reached on it. The AI debugger shows the values the program had where one failed.

Confirm what goes to GitHub#

  1. Open the posting panel.

    Select Post to GitHub….

  2. Check the destination and the kind of review.

    Check the PR number, then select Comment, Approve or Request changes.

  3. Read the preview, then post.

    The preview is exactly what GitHub will receive: the summary, with Requirements as its first section, and only the comments you approved. When it matches what you intend, click Post now.

The posting panel shows PR #12, Comment selected, the included summary, and the final Post now button.
The destination, the kind of review, and what GitHub will receive.

Review your own edits first#

Compare HEAD with Working tree (uncommitted) to review what you or an agent changed before anything is committed. Commit in Next steps, or its rail icon, opens the Commit window beside the review, so you can fix, review again and commit from one place.

Troubleshooting#

The Pull requests tab is empty

The folder needs a GitHub remote and WTFCode a GitHub sign-in (see Before you start). Check Needs my review and the filter box; a leftover filter hides everything else.

Review only runs the analyzers, and every verdict is Unclear

No model is chosen. Pick one under Settings → AI; the status bar reads AI off · add a key until you do. Or prove the requirements with a run instead.

Review keeps opening the Requirements step

The range has a draft that isn’t confirmed. Confirm it with Review against N requirements, or choose Review without requirements once for that range.

The footer says “can’t be checked as written yet”

A field has a note under it. The usual culprit is an after like “it works”.

The pull request’s description isn’t offered as a source

It is read with your GitHub sign-in; connect one as above.

A comment I didn’t approve isn’t in the preview

By design: only approved comments and the summary are sent.

Next steps#

  • Find Bugs: turn a suspicion in the review into a run that proves it.
  • AI debugger: see the values a run had where a requirement failed.
  • Inline chat: ask about one line of the diff without leaving it.

Something unclear or out of date? Tell us; a person on the team reads every note.

Search every guide: features, settings, keys and troubleshooting.

Try