Gobstopper compared with CliffCompaction
Both tools can shrink a coding agent's context without asking a model to summarize it, and both keep the newest turns untouched. CliffCompaction does it to each API request through a proxy while the session runs. Gobstopper does it to a copy of the session file that you inspect and then resume. The cliff strategy in the current source build applies CliffCompaction's drop rule to that copy. Install from source to use it; the latest tagged release predates it.
What CliffCompaction does
CliffCompaction is an open-source (MIT) API proxy for coding agents by Trang Nguyen, Eulrang Cho, Bingqing Chen, and Tim Dettmers, described in arXiv:2609.26779 (September 2026) and published on PyPI as cliffcompaction. You point an agent's base URL at it. When a request exceeds a token threshold, the proxy sends the system prompt and task verbatim, then one mechanical summary of the older turns, then the last three turns verbatim. The summary keeps tool results of at most 500 characters, drops longer ones because the files behind them are still readable, reduces tool calls to one-line signatures, and keeps assistant text. Each later compaction is rebuilt from the original history the agent resends, and the previous summary is discarded; the authors call this never compacting a compaction.
The paper reports up to 50% lower cost at a bounded context with maintained or improved Terminal-Bench 2.0 results for the Kimi and GLM models the authors tested, plus SWE-bench Verified and KernelBench results. Those are the authors' figures for their proxy. Gobstopper has not run those benchmarks.
What Gobstopper does
Gobstopper inspects Claude Code, Codex, and Devin sessions and prepares compacted transcript copies. You choose a threshold and a strategy, preview the plan, and compare strategies on the same frozen bytes. Before it writes a Claude Code or Codex copy, it archives the source and candidate bytes in a local vault, so an exact archived record can be searched and read later. It does not sit between the agent and the API, and the source build does not ask a provider to compact a running session.
How they compare
| Aspect | CliffCompaction | Gobstopper |
|---|---|---|
| Where it runs | A local HTTP proxy between the agent and the Anthropic or OpenAI API | A CLI over the session files Claude Code, Codex, and Devin write |
| What it changes | Each outgoing request, transparently, while the session runs | A separate compacted copy of a session you then resume; the source file is unchanged |
| How it shrinks | Drops tool results over 500 characters, signatures for tool calls, last three turns verbatim; never paraphrases | Strategies that drop or stub stale tool results by rule; structured and compacted add a metadata state card; no built-in strategy paraphrases unless GOBSTOPPER_DIGEST=apple has an on-device model write the card |
| Recompaction | Rebuilt from the original history; the prior summary is discarded | cliff on a copy drops the same records as one pass over the source when both passes produce a plan; strategies that inject a state card carry it forward into the next copy |
| What holds the originals | The agent's own history and the files on disk; the proxy keeps only an in-memory cache of compacted prefixes | A content-addressed vault with search-snapshot and read-snapshot for the exact archived record |
| Evidence published | Terminal-Bench 2.0, SWE-bench Verified, and KernelBench results in the paper, on Kimi, GLM, and GPT-5-mini models | Offline replays of 729 archived sessions, literal retention probes, and dated single-session trials; no task-success or billing claims |
| Model needed | None; the summary is mechanical | None for built-in strategies; optional model scorers |
The cliff strategy
cliff keeps the head (the system prompt and the first user prompt) and the newest keep_recent_turns assistant steps byte-for-byte, drops older tool results larger than result_max_bytes except the newest keep_recent_tool_outputs (default 8), and leaves smaller results, user prompts, assistant text, and reasoning in place. The defaults are three steps and 500 bytes, the proxy's defaults. A step starts where the assistant side resumes after a user prompt or a tool result and includes the tool results that answer it. Nothing is summarized, no state card is added, and there is no floor to reach: the copy is as small as the rule makes it.
When both passes run at the same cut and both produce a plan, the records dropped from the source and then from a cliff copy are, together, the records a single compaction from the source would drop. That is the file-side analogue of never compacting a compaction; a unit test in the repository checks one synthetic case. A copy below the trigger or the minimum savings is not compacted again, so the two paths can differ. Two parts of the proxy's rule are not part of the copy: tool-call signatures and reasoning caps, because Gobstopper's copy transforms replace tool-result payloads only. Codex compacted records count as one result.
gobstopper plan <session> --strategy cliff
gobstopper eval <session> # cliff appears beside the other strategies
# ~/.config/gobstopper/config.toml
[presets.cliff]
strategy = "cliff"
keep_recent_turns = 3
result_max_bytes = 500
keep_recent_tool_outputs = 0Which one fits
Use CliffCompaction when you want request-time compaction of a live session for any client that speaks the Anthropic Messages, OpenAI Chat Completions, or OpenAI Responses API, with no change to the agent. Use Gobstopper when you want to see what a compaction would remove before it happens, compare strategies on frozen input, keep the exact source, and resume a smaller copy of a Claude Code or Codex session. The two tools have not been tested together.
Questions
Can I run CliffCompaction and Gobstopper together?
They work at different layers, so nothing prevents pointing an agent at the proxy and inspecting or copying its session files with Gobstopper. The two tools have not been tested together, and Gobstopper does not proxy API requests. A Gobstopper copy resumed under the proxy would be compacted again by the proxy's own rule.
Does the cliff strategy reproduce CliffCompaction's benchmark results?
No. The cost and Terminal-Bench figures are the authors' measurements of their proxy on the Kimi and GLM models they tested. Gobstopper's cliff strategy applies the same drop rule to a transcript copy, but Gobstopper has not run those benchmarks, and a smaller copy is not evidence of a lower bill or a successful continuation.
Where do the dropped tool results go?
CliffCompaction drops them from the request; the agent can read the file or rerun the command. Gobstopper stores the exact source and candidate bytes in a local vault before it writes a copy, so gobstopper search-snapshot and gobstopper read-snapshot can return the archived record. Neither tool makes an agent notice that a fact is missing.
Why does auto not pick cliff?
The default strategy compares file strategies by projected savings and preserved prefix against a floor. Cliff has no floor: its yield is whatever the size rule removes. Choose it with --strategy cliff or a preset so the trade is explicit.
Sources
- Trang Nguyen, Eulrang Cho, Bingqing Chen, and Tim Dettmers, CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents, arXiv:2609.26779, September 2026.
- CliffCompaction source and README (MIT).
- The authors' project page.
- Gobstopper README, which carries the same comparison table.