ClaudeMulti-file workflowsLevel 3: Workflows

How Do You Keep Claude's Big Diffs Reviewable?

Have Claude split the work into separate commits, each with one job, then review them one at a time with /code-review and a commit range. Decide the split before committing, and require each commit to build and pass tests on its own.

Prompt to copy
This work mixes several kinds of change: [list them]. Before committing anything, group it into separate commits, each with one purpose, in this order: (1) refactors with no behavior change, (2) the behavior change, kept as small as you can, (3) formatting and import cleanup.

Show me the commits you plan: the files, a one-line message and how I can check each one. After I approve, make them. Each commit must build and pass [test command], so run it at every step and show me the result. Don't push.
  1. 1refactor: extract validateCartno behavior change, so skim
  2. 2feat: apply coupon codesthe real review goes here
  3. 3style: format touched filesskim
Rule of thumb, not an Anthropic chart, shown with this page's coupon example: each commit runs the tests, and you can revert one alone.

Try it now

  1. 1Send the prompt in Claude Code, and correct the plan. If a file belongs to two commits, ask how it will separate them.
  2. 2Read git log --stat afterward to confirm that each commit touches what it said it would.
  3. 3Run /code-review abc1234^..abc1234 on the behavior commit, with its real hash.
  4. 4It worked if you can revert the behavior commit alone, and the mechanical commits needed only a skim.

Use it when

Any time you'd say "I'll clean this up while I'm here", and any session where the diff has grown past what one person will read carefully. It needs Claude Code, since Claude has to make the commits and run the tests.

Skip it when

A small change with one purpose, which is already one commit. And don't split so finely that commits stop building, or into dozens of tiny steps. Both make the history harder to follow and to bisect.

Why it works

Claude tends to widen a change. Anthropic's Sonnet 5.5 guide says the model adds tests, documentation and small supporting files you didn't ask for, at every effort level and more at higher effort. Often that's welcome, but it can blur the diff. Splitting by purpose means a mechanical commit can be skimmed, while the behavior change gets real attention. Tooling then helps, because /code-review accepts a target: abc1234^..abc1234 reviews one commit and HEAD~3..HEAD a range. Reviewing a focused commit also limits how much a reviewer has to consider. Splitting by concern is a rule of thumb, not a vendor figure.

Example

A coupon feature touched files that also needed cleanup. The plan comes back as refactor: extract validateCart, no behavior change, then feat: apply coupon codes at checkout, then style: format touched files. Each runs pnpm test. Reviewers skim the first and last, and /code-review looks closely at the middle one. If coupons cause trouble later, you can revert that commit and keep the refactor.

Going further

Stop the mixing earlier. Add a system prompt or CLAUDE.md line such as Don't add tests, docs or refactors I didn't ask for. Suggest them at the end., which is close to what Anthropic's Sonnet 5.5 guide recommends. Watch your hooks as well. A formatter on PostToolUse rewrites each file Claude edits, so if the repo isn't already formatted, that noise lands in every commit. Format everything once in its own commit first. For the push, use a rule instead of a sentence: add "ask": ["Bash(git push *)"] under permissions. Anthropic's docs warn that saying don't push until I've reviewed can get lost when a conversation compacts.

Common mistakes

  • Letting a quick cleanup ride along in a feature commit, which hides the one line that needed review.
  • Splitting into commits that don't each build, so a later bisect lands on a broken commit and can't test it.
  • Expecting /simplify to separate things for you. It applies cleanup fixes to the changed code, and it adds to the diff you're trying to shrink.
  • Fixing every review finding. Anthropic's docs warn that a reviewer told to look for problems always turns up some, so ask it to skip style.

Sources

Checked 6 November 2026. Products change often, so confirm details with the vendor.

Related

Beyond the course