headroom vs rtk
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 — Rust CLI proxy compressing dev-command output 60-90% before your agent reads it — git, tests, linters, docker, 100+ commands; hooks auto-rewrite bash calls. Single binary, <10ms overhead.
Both shrink what the agent reads, at different layers: headroom proxies your LLM traffic and squeezes tool outputs, logs and RAG chunks 20-95%; rtk rewrites the shell commands themselves — no proxy in your API path, single binary.
| headroom | rtk | |
|---|---|---|
| Stars | 63k | 74k |
| Forks | 4.7k | 4.6k |
| Language | Python | Rust |
| License | Apache-2.0 | Apache-2.0 |
| Last activity | yesterday | today |
| Topics | coding, gateway | coding, local |
| Curated connections | 4 | 2 |
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.
rtk — the curator's take
The rare token-saver whose README explains why its headline number is NOT your bill cut — bash output is one slice of input tokens, and the savings dilute; that honesty earns trust. Two things to know before judging your gains: the hook only intercepts Bash tool calls (Claude Code's built-in Read/Grep/Glob bypass it entirely), and `rtk gain` estimates tokens at bytes/4, not with a tokenizer. Compression is lossy by design — when a debugging session goes weird, the clue may be in the output rtk collapsed; `rtk proxy` is the escape hatch, use it. Beware the crates.io name collision with Rust Type Kit.