Technique 08 / 14 · Noise reduction
Diff compressor
Read large diffs as the changes themselves, not pages of unchanged surrounding code.
Interactive model
See the context change.
git diff on a session helper with a two-line fix.
git diff src/auth/session.ts
- 01
@@ -29,5 +29,5 @@
- 02
2 lines of context
- 03
- const maxAge = 60 * 60
- 04
+ const maxAge = 60 * 60 * 24
- 05
2 lines of context
Conceptual demonstration. Counts illustrate the flow, not measured production savings.
How it works
Less context. Same thread of work.
Unified diffs pad every change with unchanged lines, and a large refactor can run to thousands of them. DistilCode’s diff compressor, ported from headroom, keeps every added and removed line and trims context to two lines around each change.
Hunks per file and files per diff are capped, preferring the ones relevant to your request, and the summary says how many hunks were omitted. The full diff stays available through viewraw.
In practice
The operating loop
- 01
Keep every change
All + and − lines survive unchanged.
- 02
Trim the context
Unchanged lines are cut to two around each change.
- 03
Cap the sprawl
Hunks per file and files per diff are capped, with omissions reported.
