An independent journal. Not a shop, and not affiliated with the tools it writes about. Disclaimer

A diff sheet marked in three passes: the file list, one changed hunk, and a leftover block, with a pencil beside the page.
A diff sheet marked in three passes: the file list, one changed hunk, and a leftover block, with a pencil beside the page.

Coding

Review a generated diff in three passes

25 September 2026 ยท 2 min read

Look at the file list, then the behavior of each hunk, then what the change left behind. Do not mix the passes.

A generated diff is often too large to “just read.” The way through it is to refuse to read it all at once. Three passes, in order, catch different failures. The sheet at the top of this piece is that order: first the list of files, then one hunk’s behavior, then the leftover that should not have survived.

Pass one: the boundary of the change

Read only the file list and the size of each file’s change. Ask whether every path was in the request. A formatter sweep, a renamed public function, a lockfile, or a new folder is a second change hiding in the first. Set those hunks aside before you admire the fix in the file you did ask for. If you read the good hunk first, you will talk yourself into keeping the extra paths because the fix “basically works.”

Pass two: what a caller can observe

For each remaining hunk, write one sentence a caller could check. “Empty names are rejected and nothing is saved.” If you cannot write the sentence, you do not know what the hunk does, and it does not land. While you write it, look for the quiet inversions: a broader catch, a default that turns a thrown error into a returned empty value, a test that asserts the mock was called rather than the result.

Do this on the diff, not in a second chat that explains the diff. An explanation will agree with the patch. The sentence you write is the thing you can compare to the test plan. If the sentence and the tests disagree, the tests are the next edit, or the hunk is.

Pass three: leftovers

After the behavior is acceptable, look for what the change did not need. An unused parameter. A comment that describes the code you deleted. A helper that nothing calls. A log of the entire object. These are not neutral. The next prompt will treat them as the style of the module and repeat them. Delete them in this pass, while you still remember they were not requested.

Stop between passes

If pass one fails, do not continue. Send the extra files back, or delete them yourself, and review the smaller diff. A three-pass review of a diff that should have been two files is how an afternoon disappears into a redesign. The passes are short only when the change was small enough to ask for in the first place.

CursorUltra Blogs is an independent journal. It is not affiliated with the tools mentioned in this piece, and nothing on this website is for sale. Read the disclaimer.