A software engineer in San Francisco gets 100 tool results from a codebase search. Every output needs to reach the model. By default: 65,000 tokens.
An SRE in Seattle gets a 200k-line incident log dump. Every relevant line needs to be analyzed. By default: context explosion and $40 per query.
An AI researcher in Boston gets 300 RAG chunks for a complex reasoning task. Every document needs to fit in context. By default: hours of manual pruning.
Every one of them is losing thousands of dollars and hours of their life to bloated context.
Now meet Headroom.
A free and open source tool that compresses tool outputs, logs, files, and RAG chunks before they reach the LLM. 60-95% fewer tokens. Same answers.
You give it a 65,000-token agent trace. You get a clean 5,000-token version back in milliseconds.
What makes it different from every other context optimizer:
Specialized compressors. SmartCrusher for JSON, AST-aware CodeCompressor, and ML-based Kompress for prose.
Reversible compression (CCR). Originals stay on your machine. The model can retrieve anything it needs on demand.
CacheAligner. Stabilizes prefixes so you actually hit provider KV cache discounts (Claude’s 90% read savings).
Proxy mode. Zero code changes. Drop it in front of any agent.
Output token reduction. Also trims what the model writes back — no more repetitive preambles or overthinking routine steps.
Cross-agent memory. Shared reversible store across Claude, Cursor, Aider, LangChain, and more.
Three ways to use it:
Library. One function call: compress(messages)
Proxy. headroom proxy --port 8787 — works with any language or app
Agent wrappers. headroom wrap claude, headroom wrap cursor, headroom wrap aider
Plugs into Claude Code, Cursor, Aider, LangChain, CrewAI, Agno, LiteLLM, MCP, and AWS Strands. Drop it into your existing agent stack today.
The story:
The headroomlabs-ai team was burning through tokens while building heavy multi-agent systems. Every tool call and RAG retrieval was 70-95% boilerplate. Existing solutions either lost accuracy or required painful manual work. They built their own compression layer. Then they open sourced it.
50,800 stars. Apache 2.0 license. Fully local. Reversible.
Anthropic and OpenAI charge per token with no compression. Your bills keep growing as agents get more powerful.
Manual summarization tools take hours and lose critical details.
Commercial context platforms still send most of the noise through.
Headroom costs $0. Runs on your laptop. Your data never leaves your machine. Accuracy stays the same.
Here is the wild part.
The software engineer compressed his 65k-token codebase search down to 1,400 tokens. Same answer in seconds.
The SRE fed in the 200k-line incident log. It became 5,100 tokens. Root cause found in one shot.
The AI researcher sent 300 RAG chunks. They became 19% of the original size. The model still got every key fact.
The bloated context your AI agents have been choking on for months now takes Headroom milliseconds.
Your tool outputs become compressed context. Your context becomes efficient prompts. Your prompts become faster, cheaper, and more reliable answers.
The tokens (and money) you used to lose to context bloat are back in your hands.