Compaction

Longer sessions,
smaller bills.
Your code stays on your machine.

Compaction cuts both sides of AI coding calls: ~48 to 50% less input and ~50 to 70% less output in provider-measured runs. Local across Claude Code, Codex and Cursor.

curl -fsSL https://cli.compaction.dev/install | sh
compaction
compaction gateway status
gateway running · record mode · anthropic
receipts .compaction/gateway/receipts.jsonl · local-only
 
tail -n 1 .compaction/gateway/receipts.jsonl
{
  "provider": "anthropic",
  "model": "claude-sonnet-4-5",
  "mode": "record",
  "tokens": { "prompt_input": 128410, "cached_input": 121830, "output": 2410 },
  "fresh_billed_input_reduction": { "available": true, "pct": 94.9 },
  "token_source": "provider-reported",
  "sync_status": "local-only",
  "content_uploaded": false
}
 
# one content-free receipt per call: counts and labels, never your content
A real receipt's shape; figures vary by task
01 · Less in. Less out.

Less in.
Less out.

Compaction attacks both sides of every AI call. Agents repeatedly resend long histories and generate more than every task needs. Compaction reduces both.

Request
41,210input tokens
21,876input tokens−47%
Response
540output tokens
286output tokens−47%est.

Compact old context before it is sent. Prevent unnecessary generation before it is produced.

02 · One line. The whole turn.

One line.
The whole turn.

A developer doesn't have to trust a marketing dashboard. Compaction tells them what happened on the turn itself. Watch what disappeared.

compaction·
input 41,210→21,876 (−47%)·
output 540→286 (−47%, est)·
−$0.05·
id 8f4c2f6e
Input
41,210 → 21,876
context compacted
Output
540 → 286
generation reduced
−$0.05
provider-priced
local estimate
8f4c2f6e
receipt
recovery available
03 · Keep what matters

Keep what matters.
Compact everything else.

Compaction protects the state that still matters and compresses the history that no longer does. Selective reduction, not blind truncation.

13 context items
  • Current taskwire retry budget into gateway proxy
    Preserve
  • Old tool output2,140 lines · npm test (run 1 of 4)
    Compact
  • Codeproxy.ts · retryWithBudget()
    Preserve
  • Resolved discussionnaming: budget vs. allowance, settled
    Compact
  • Commandpnpm --filter api test -- --runInBand
    Preserve
  • Superseded approachearlier setInterval polling draft
    Compact
  • File pathapps/api/src/gateway/proxy.ts
    Preserve
  • Repeated contextenv matrix pasted 3× across turns
    Compact
  • Constraintkey never read, stored, or logged
    Preserve
  • Dead endabandoned edge-cache experiment
    Compact
  • Unresolved errorETIMEDOUT on cold gateway start
    Preserve
  • Obsolete historysetup logs from a prior branch
    Compact
  • Current state3 of 5 checks passing
    Preserve
State capsule
6 low-value items · byte-exact original recoverable
Recover
04 · Keep your agents. Keep control.

Keep your agents.
Keep control.

No new editor. No new agent. Compaction works underneath the tools you already use. The request goes straight from your machine to your provider.

Your machine
Claude Code
Codex
Cursor
Compaction
InputOutputMeasureRecover
Your provider

direct · no middleman

Code stays local
never uploaded
Provider key stays local
never read or logged
Content-free receipts
counts and labels only
Byte-exact recovery
originals recoverable
05 · Every change leaves evidence

Every change
leaves evidence.

Compaction doesn't just optimize a turn. It records why, how much, and whether the original can be recovered, as a content-free object you can read.

provider-reportedrecoverability passedlocal estimate
compaction.receiptid 8f4c2f6e
policy
stale_tool_output_to_state_capsule
family
tool_output
input
41,210 → 21,876
reduction
−47%
source
provider-reported
recoverability
passed
original
available
receipt
8f4c2f6e
counts, labels and evidence metadata. Never prompt, code or response content
06 · One developer, every AI workflow

One developer sees a receipt.
A team sees the system.

Give every AI workflow the same optimization layer. Developers get longer sessions and less noise. Engineering sees where the tokens go. Finance sees what changed and what it was worth.

Get started
Compaction WorkspaceAI usage · last 7 days
Before → After
Input tokens reduced
48.6M
provider-reported
Output tokens reduced
12.3M
provider-reported
Optimization rate
51%
measured
Est. provider cost avoided
$1,842
est.
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Group by
NameUsageTokens reducedReductionEst. valueEvidence
Claude Code14.2k runs22.1M−53%$812est.provider-reported
Codex9.6k runs15.4M−49%$564est.provider-reported
Cursor7.1k runs8.9M−44%$466est.local estimate
07 · Every saving has a source

Every saving
has a source.

Most AI cost tools tell you what you spent. Compaction changes what you spend, then shows its work.

Before
$1,842
After
$1,219
Difference
−$623
est. provider cost = provider usage × published price
model
claude-fable-5
source
provider-reported
pricing
2026-08
basis
provider-priced estimate
Local estimateProvider-reportedStronger evidence

Try it on your next session.
See what disappears.

curl -fsSL https://cli.compaction.dev/install | sh