CLI
Detect, plan, apply, verify, undo — every step inspectable before anything changes.
gobstopper plan <session> --trigger 250000
gobstopper apply <session> --strategy elide
gobstopper verify <session> && gobstopper undo <session>gobstopper is the first cross-provider context compactor that preserves a content-addressed archive of every conversation state, resumes compacted sessions on both Claude Code and Codex, and proves the savings on real API calls.
Free and MIT licensed. Rust 1.85 or newer, local transcripts, no account. First Gobstopper release in preparation — install from source today.
$ claude --resume 034... --autocompact 100
# provider added 59 records, removed 0
$ gobstopper apply 034... --in-place --strategy compacted
# elided 43 records, injected digest, resumed cleanly
$ gobstopper diff 034-original 034-compacted
removed: 43 added: 46 (43 stubs + 3 tail records)Providers compact late — near the top of the context window, where every turn is most expensive and recall is already degrading. Gobstopper moves the boundary down and lets you choose what happens there.
Scans Codex and Claude Code transcript stores for live and idle sessions, reading each provider's own token-usage records — real context size where available, with a fallback estimate otherwise.
Every strategy lowers to the same edits — elide, inject digest, provider compact — and the host validates the candidate before publication. Provider linkage (parent chains, ordinals) is never removed, only rewritten in place within a line.
auto picks by transcript shape; sawtooth delegates to the provider's native compaction; elide masks stale tool output; structured emits a conservative state-card placeholder; agentic is reserved for a bounded editor-model backend.
Global defaults, per-provider and per-session overrides, named presets, an explicitly-trusted legacy command hook, and versioned plugin bundles with exact artifact identity and host-side edit validation.
Every apply snapshots the transcript into a content-addressed vault first. gobstopper undo restores byte-identical bytes into a new fork — the original transcript is never overwritten by a standalone compaction.
Every mutation emits a compaction event for dashboards. gobstopper eval runs all strategies on temp copies and scores structural retention; it is a regression signal, not a live cost measurement.
The same plans, edits, and safety rails underneath each entry point. There is no agent-only path behind the convenient one.
Detect, plan, apply, verify, undo — every step inspectable before anything changes.
gobstopper plan <session> --trigger 250000
gobstopper apply <session> --strategy elide
gobstopper verify <session> && gobstopper undo <session>A polling daemon that stages a plan before the threshold and publishes a validated copy when crossed — or provider hooks that snapshot and log around native compaction.
gobstopper watch --trigger 250000 --double-buffer
gobstopper install-hooks # Claude settings + Codex hooks.jsonpreset.command receives normalized transcript JSON and returns edits. A versioned plugin bundle declares capabilities and a checked executable for the same seam.
[presets.my-policy]
strategy = "elide"
keep_recent_tool_outputs = 4
[presets.custom]
command = ["node", "my-editor.js"]Compaction that breaks a resume chain or hides a failure is worse than none. The constraints are enforced in code, not promised in prose.
These rules are enforced by the command surface and its tests, not by convention.
First Gobstopper release in preparation — install from source
cargo install --git https://github.com/hraness/gobstopper gobstopper
gobstopper --helpgobstopper detect
gobstopper plan <session> --trigger 250000
gobstopper watchNeeds Rust 1.85 or newer. Reads Codex and Claude Code transcripts locally; nothing leaves the machine. Read the full reference.
Compaction lowers context occupancy in a sawtooth model: average context per turn is roughly (trigger+floor)/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 runs. We report file-byte changes and observed provider usage where available; we do not claim dollar or quota savings without a completed benchmark.
Standalone `apply` or `watch` produces a separate, validated transcript copy and leaves the source unchanged. For a session the provider is actively serving, Gobstopper delegates to provider-native compaction — Codex thread/compact/start over the app-server protocol, Claude /compact through stream-json. Local rewrites only touch idle transcripts, and always with a vault snapshot first.
gobstopper undo restores the exact bytes into a new fork, leaving the current transcript untouched. gobstopper eval replays every strategy against a transcript copy and reports probe recall — which verbatim details survived — plus post-rewrite integrity findings, so you can pick a strategy with evidence before trusting it live.
Codex and Claude Code today, over their real transcript formats. The edit IR is provider-neutral, so another JSONL-transcript agent needs only a small adapter.
Yes — a `preset.command` pipes normalized transcript JSON to a program and applies the edits it returns, or a versioned `gobstopper-plugin.json` bundle declares capabilities and a checked executable. Host-side validation bounds every proposal: no edit can grow the transcript, skip protected recent output, bypass linkage checks, or exceed digest size. Trusted subprocesses are not security sandboxes, so explicit trust and artifact identity are required.
Ben Guo, a musician and builder, formerly a founder and engineering leader at companies including Venmo and Stripe, now building from Puerto Rico. Gobstopper is published by Hraness under the MIT license.
Gobstopper is built by Ben Guo, a musician and builder, formerly a founder and engineering leader at companies including Venmo and Stripe, now building from Puerto Rico. It is published by Hraness under the MIT license.
Set a trigger, pick a strategy, and stop paying for the same 900k tokens on every turn.
Free and MIT licensed. Rust 1.85 or newer, local transcripts, no account. First Gobstopper release in preparation — install from source today.