
Headroom is an open-source, local-first context compression layer for AI agents, created by Tejas Chopra and now developed at Headroom Labs. It sits between your agent and the model provider and shrinks tool outputs, logs, files, and RAG chunks before they reach the LLM, while caching the originals so the model can pull them back on demand. In its published measurements it cuts tokens by 21 to 57 percent, and up to 90 percent on redundant JSON.
Core Features
- Content-aware routing picks the right compressor for JSON, code expressed as an AST, or natural prose.
- Runs locally as a Python or TypeScript library, a local proxy, or an MCP server.
- One-command agent wrap works with Claude Code, Codex, Cursor, Aider, and more.
- Reversible compression caches originals so the model can retrieve full text via a tool.
- Optional output shaping trims verbose model responses to lower the token bill further.
Use Cases
- Cut the token cost of agents that read huge build logs or JSON responses.
- Fit long tool output into a context window without losing the error line.
- Add compression through a proxy with zero application code changes.
Pricing
Headroom is free and Apache-2.0 licensed, installable via pip, npm, uv, or Docker. There is no commercial plan; the only cost is your own compute, since compression runs on your machine and data never leaves it.
Pros and Cons
- Pro: Local-first and Apache-2.0, with token savings that directly cut API bills.
- Con: Plain prose compresses far less than JSON, so savings vary by workload.
Our Take: Best for engineering teams running token-hungry agents on Claude Code or Cursor; the trade-off is that plain prose compresses less than JSON, so the biggest savings show up on structured, repetitive output.
Find more efficiency tooling in our Efficiency improvement category.




