01
Headroom — a local proxy that compresses tool output before your coding agent pays for it
Headroom (Apache-2.0, Python with a Rust core, 75,983 stars, 317 of them today on GitHub trending, v0.41.0 on Wednesday) sits between a coding agent and the provider and shrinks what the agent reads: tool output, logs, files, RAG chunks and history. A content router sends JSON to a statistical crusher that keeps errors, outliers and the first and last items, code to an AST-aware compressor, and prose to a small Hugging Face model, Kompress-v2-base. The originals stay cached locally, and the model gets a headroom_retrieve tool to fetch the full text when the summary isn't enough. headroom wrap claude (or codex, aider, opencode and a dozen others) starts the proxy and launches the agent through it; headroom proxy --port 8787 serves any OpenAI-compatible client; headroom unwrap undoes it.
The numbers are the project's own and honest about their range. On four seeded scenarios built from real MCP output formats, it saves 21% on code search, 30% on issue triage and 57% on an incident log, and the README says prose and dense output "compress very little." The accuracy table runs 100 questions per benchmark and says itself that a three-point TruthfulQA gain is inside the confidence interval. What crosses the hop also changes in ways you didn't ask for. Tool search on Anthropic requests is on by default in the open-source build. wrap installs the Serena code-navigation MCP server into ~/.claude.json unless you pass --code-memory none. An anonymous beacon is on by default and reports compression ratios, provider and model IDs, OS and architecture (never prompts, code or paths). It turns off with HEADROOM_TELEMETRY=off or DO_NOT_TRACK=1. The output-trimming features, which append a terseness note to your system prompt and lower thinking effort after tool results, are off unless you set HEADROOM_OUTPUT_SHAPER=1.
Reach for it if your agent sessions spend most of their tokens reading logs and JSON. Delete the hand-written jq filters you pipe tool output through. Tradeoffs: it changes the request your provider sees, so put it behind something that logs before and after if you need to debug a bad answer; telemetry is opt-out; the savings figures come from the vendor's own fixtures; and the README carries an Enterprise upsell for routing and prompt-injection filtering.