Methodology

Providers compact late — near the top of the context window, where every turn is most expensive and recall is already degrading. Gobstopper treats compaction as a policy problem: when to compact, how to compact, and where to apply it.

Occupancy model

Context is a sawtooth. If you compact at trigger T and the summary floor is F, steady-state context occupancy per turn is roughly (T+F)/2. A 250k/40k policy is ~3.3x lower occupancy than a 1M-window default, and 150k/20k is ~5.6x lower.

These are occupancy projections, not measured subscription savings. Real cost depends on cache hit rates, billing for summary turns, re-fetches from lost detail, and how often compaction itself runs.

Strategies

Structural diff and the undo vault

Every mutation is stored in a content-addressed vault. Records are shared by hash, so unchanged content is never duplicated. Thegobstopper diff command compares two snapshots by record hash and reports exactly which records were added, removed, and kept — not a line-by-line text diff. With serde_json preserve_order enabled, in-place rewrites keep unchanged records byte-identical, so the diff reflects only the intended structural change.

Honest measurement

We report file-byte changes and observed provider usage where available. We do not claim dollar or quota savings without a completed benchmark. The local benchmark example emits CSV of byte and projected-token reduction across synthetic transcripts; the online benchmark measures task completion, latency, re-fetches, and cached/uncached split on real provider sessions.