claudecompress v0.16.8 · theory · github · npm
Claude Code

is missing two things.

  • A cache-aware status line so you know when your next message is expensive.
  • A trimmer to make /resume actually usable.

Cold /resume is expensive. Handoff docs lose context.
claudecompress fixes both.

Quick install
bun add -g claudecompress
claudecompress install
Max 5x · 5-hour block
save up to 75% safe mode · minimal loss
cold /resume on 760k · 13% of block as low as 3%
Trim

Trim without losing the thread.

safe (the default) keeps your last 5 exchanges fully intact: tool outputs, thinking, file contents. Older turns get observation-masked. Tool call names and file paths stay as breadcrumbs; bodies drop. Research-aligned with JetBrains' 2025 observation-masking study.

  • safe ~67% default, minimal loss
  • smart ~76% per-component rules by turn depth
  • slim ~81% aggressive, drops older breadcrumbs

Run via ccw for seamless resume, or bunx claudecompress standalone.

Inside a session
┌─ claudecompress ───────────────────────┐ mode: safe (last 5) · drop older thinking tokens: 760k 511k (saved ≈ 249k) cost: $7.61 $3.37 (saved ≈ $4.24) trimmed: 17420d99-7152-4359-bfdd… └────────────────────────────────────────┘ Ctrl+C, then: claude --resume 17420d99…
Any saved session
$ bunx claudecompress # lists your sessions, staleness, cost # pick a mode, confirm # new trimmed JSONL lands beside the old
Savings

Save up to 75% of a block, with minimal context loss.

Dollar cost isn't the right metric for Claude Code. On a Max 5x plan you feel the 5-hour rate-limit block long before you feel billing. So we measure in % of that block. (Independent analysis suggests cache reads don't count against the block on subscription plans — only the cold portion does, which is exactly what /resume generates.) A cold /resume on a 760k session eats ~13% of your quota. safe (default, research-aligned) drops it to ~3%. More aggressive modes go further, with real tradeoffs. Each tab is a real session we measured.

Mode Tokens % saved % of 5hr block
Baseline760k·13.2%
lossless
safe
smart
slim

Block-usage column anchored on our 760k baseline, which consumed ~13% of a Max 5x plan's 5-hour rate-limit quota. Scales linearly; verify on your own sessions with bunx claudecompress.

Install

Install. Restart. Done.

Install global. The status line ticks every second and needs fast startup. Bun preferred, Node fine. settings.json is backed up; nothing overwritten without a prompt.

Global install
bun add -g claudecompress
claudecompress install
# then quit and relaunch Claude Code