← Registry
Loop Official

Surgical Diff Shrink

Shrink an over-broad diff back to the minimum that satisfies the goal — every changed line load-bearing, no drive-by edits — re-running tests after each cut.

A craft loop that attacks the size of the diff itself rather than its quality. Each pass reverts one hunk not strictly required by the goal — reformatted untouched lines, speculative helpers, taste-only renames, defensive branches nothing reaches — then re-runs the tests to prove the goal still holds. It exits when no further line can be removed without breaking a test and the changed-line count stops shrinking.

Loop

Goal
the diff contains only changes strictly required by the goal — every remaining changed line is load-bearing and tests still pass
Exit when
no hunk can be reverted without failing the goal or a test, and the changed-line count stops shrinking between passes

Check between iterations

git diff --stat main...HEAD && git diff main...HEAD | grep -cE '^[-+]'
$

Kickoff prompt

Start the "Surgical Diff Shrink" loop. Goal: the diff contains only changes strictly required by the goal — every remaining changed line is load-bearing and tests still pass Max iterations: 6 Between iterations run: git diff --stat main...HEAD && git diff main...HEAD | grep -cE '^[-+]' Exit when: no hunk can be reverted without failing the goal or a test, and the changed-line count stops shrinking between passes Step 1: Read the full diff and list every hunk not strictly required by the goal — reformatted untouched lines, speculative helpers, taste-only renames, unreachable branches — then revert the most clearly unnecessary one and re-run the tests.