headroom vs token-optimizer
Context compression layer for agents: squeezes tool outputs, logs, files and RAG chunks 20-95% before the LLM — reversible, local-first; library, proxy, one-command agent wrap, or MCP. — versus — Context-waste hunter for coding agents: hooks compress reads, bash and search output, checkpoint before compaction, and audit waste in configs, skills, MCP and memory — with a local dashboard.
Same goal, different reach. Headroom is a reversible compression layer for tool outputs, logs and RAG chunks, and injects instructions to do it; Token Optimizer compresses more surfaces (search, re-read diffs, structure maps) with zero baseline context overhead, and adds compaction survival and structural audits Headroom does not attempt.
| headroom | token-optimizer | |
|---|---|---|
| Stars | 68k | 2.1k |
| Forks | 5.2k | 161 |
| Language | Python | Python |
| License | Apache-2.0 | NOASSERTION |
| Last activity | yesterday | 2 days ago |
| Topics | coding, gateway | coding, skills |
| Curated connections | 5 | 6 |
headroom — the curator's take
The dedicated answer to context bloat: content-aware compressors route JSON, logs and code differently (60-95% on JSON, 15-20% on real coding sessions), originals stay cached so the model can retrieve what compression dropped — the reversibility is what makes aggressive ratios safe. Adoption cost is near zero: `headroom wrap claude` and you're running, or use it as proxy/library/MCP. Prompt-cache-aware alignment avoids torching your cache hit rate. NOT free lunch: a lossy-in-context layer between agent and model is another thing to debug when the model 'misses' something — budget for retrieval round-trips — and the 20% coding figure is the honest number, not the 95% headline.
token-optimizer — the curator's take
The one token tool that argues with the others in its own README, and mostly wins the argument. Compressors like Headroom and RTK cover command output — roughly 15-25% of your context. Token Optimizer covers eight surfaces (bash, grep, tabular, file-re-read diffs, structure skeletons, archived large results, model verbosity, structural context) and then keeps going: checkpoints before auto-compact so savings survive it, model-routing nudges, loop detection, 30-day trend coaching, and per-component audits of CLAUDE.md, skills and MCP. It is cache-safe, injects nothing into your context, and measures before/after. The costs are real too: it is a large Python/TypeScript surface with 92 env knobs and 15 SQLite tables doing hook surgery on every Read and Bash, its headline dollar figures are counterfactual models against the author's own frozen baseline, and the license is non-standard. Pick RTK if you want one boring binary; pick this if you want the whole waste budget attacked and instrumented.