unrust

AI code review guide

How do you review multi-file diffs from Cursor or Claude Code?

Published

Published by Unrust. Scoring and editorial method

Quick answer

To review a multi-file diff from Cursor, Claude Code, or Copilot safely, inspect the cross-file contract before reading individual lines: verify that every caller and callee agree on boundary values (0, false, null, empty arrays), check that error paths do not silently swallow failures with fallback defaults, and confirm that no unrelated helper or test assertion was weakened to make the build pass.

Why agentic multi-file diffs require seam-first review

Agentic coding tools can edit a route handler, a service module, a type definition, and a test file in a single turn. Each file in isolation usually compiles cleanly and follows local naming conventions.

The most common defects hide at the seams between those edited files: a helper normalizes an optional parameter with || instead of ??, a catch block returns an empty array that a caller treats as 'no pending records', or a test assertion is relaxed to match buggy output.

Read the test diff and type changes before the implementation

Start your review with the test file and shared type signatures. If an agent modified existing test expectations or widened a parameter type to any or unknown, ask whether the change reflects a legitimate requirement update or a shortcut to silence a failing check.

Next, pick one concrete boundary input—such as an explicit false flag, a zero retry budget, or an empty generator—and trace it across every file the diff touched.

Audit silent fallbacks and partial-failure cleanup

Generated diffs frequently wrap asynchronous calls in try/catch blocks that log a warning and return a benign-looking default. Trace what the caller does with that default: if it commits state or marks a job complete, the fallback just turned a transient outage into silent data loss.

Use Unrust's text diff and boundary explorers to inspect code changes with a concrete counterexample in mind before approving.

An agentic multi-file diff review table

Use this table when auditing multi-file pull requests or composer diffs generated by Cursor, Claude Code, or Copilot.

An agentic multi-file diff review table
Observed conditionReview decisionWhat to verify
The diff modifies both implementation files and existing unit or integration testsInspect the test diff first to verify no existing edge-case assertion was weakened or deletedConfirm that new or updated assertions test both the happy path and the rejected/boundary neighbor
A shared options or payload object is threaded through multiple edited modulesTrace falsy and boundary values (false, 0, '', empty iterable) from the entry caller to the leaf consumerVerify that nullish coalescing (??) or explicit undefined checks preserve valid caller-supplied falsy values
The diff adds try/catch blocks or fallback return values in a helper moduleTrace how upstream callers branch on the fallback return valueConfirm that a caught error cannot be mistaken for a valid empty result or completed operation

Interactive reasoning check

Try the diff review: which multi-file change hides a defect?

An coding agent updates three files to add a dryRun option to a billing sync: 1. types.ts adds dryRun?: boolean. 2. sync.ts normalizes const isDryRun = Boolean(options.dryRun ?? true). 3. cron.ts calls runBillingSync({}) for the nightly production charge run. What happens during the nightly production run?
Read the reasoning without answering

Because dryRun?: boolean is optional, existing callers that pass {} rely on the default in sync.ts. Defaulting dryRun to true via ?? true silently disables production work for any caller that omits the flag.

A small practice loop

  1. 01Read the test diff and shared type changes first before reading implementation lines.
  2. 02Pick one omitted or falsy option ({}, { flag: false }, { retries: 0 }) and trace it across every touched file.
  3. 03Check every new catch block or default fallback to verify what the caller does when that fallback value is returned.

Common questions

Why do multi-file agent diffs often look clean on a quick skim?

Coding agents generate locally idiomatic syntax and matching variable names across files, which satisfies surface pattern recognition even when two modules disagree on edge-case semantics.

Which Unrust skill dimensions practice reviewing agent-generated diffs?

Find the Flaw (contract comprehension), AI-Slop Detection, State Debugging, and our multi-file workspace drills all practice isolating plausible defects in existing code.

Limits of this guide

This checklist covers logical and contract review of multi-file diffs; it does not replace automated test suites, static analysis, or security review. Unrust diagnostic scores are a personal snapshot and do not measure tool productivity.

Sources and scope

Original editorial guide by the Unrust team synthesizing code-review research and common cross-file failure modes in AI-assisted workflows.

Check your own starting point

Unrust uses short, timed, unassisted drills to give developers a per-skill snapshot. One session cannot explain the cause of a result, but it can show you what is worth practicing next.

Take the free diagnostic