headroom
Headroom compresses what an AI agent reads, including tool outputs, logs, RAG chunks, files and conversation history, before it reaches the model. A content router picks a specialised compressor for each type (JSON, source code via the AST, or prose via a small local model), and the originals are cached locally so the model can retrieve the full text when it needs it. Compression runs on your machine; content is not sent anywhere to be compressed.
It is useful wherever context size drives cost or quality: coding agents reading long logs and test output, agents calling APIs that return large JSON, and RAG pipelines. The project's own figures are about 20% fewer tokens for coding agents and 60–95% for JSON-heavy content. You can use it as a Python or TypeScript library, as a local proxy with no code changes, as an MCP server, or by wrapping an agent such as Claude Code, Codex, Cursor or Aider with a single command. It also offers cross-agent memory and a `learn` command that turns failed sessions into instructions in files such as CLAUDE.md or AGENTS.md.
Getting started: install the CLI with `uv tool install --python 3.13 "headroom-ai[all]"` or pip, then run `headroom wrap claude` (or another agent) or `headroom proxy --port 8787`. `headroom doctor` checks the setup and `headroom dashboard` shows live savings.
Features
Why choose it
Trade-offs
Maintenance check
- Last commit
- 2026-10-24
- Commits, last 90 days
- 100+
- Releases, last 90 days
- 15
- Latest release
- v0.41.0 (2026-10-14)
- Open issues
- 531
- Recent issues with at least one comment
- 5/22
Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.
Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.
Who it fits
- Long tool output, logs, JSON responses or RAG chunks are driving up cost or hurting answers.
- You want compression without code changes: run it as a local proxy, an MCP server, or by wrapping Claude Code, Codex or Cursor.
- Compression must run locally, with originals cached so the model can retrieve the full text.
- Your agent's problem is missing or outdated docs, not too much context: a docs server fits better.
- You cannot add a component that must keep running and may add latency.
- Your tasks cannot tolerate lossy compression: verify answer quality on your own work first.
How it differs
Ref trims documentation it fetches from its hosted index. Headroom compresses any content the agent reads, locally.
jCodeMunch avoids reading whole code files by fetching symbols. Headroom compresses tool output, logs and JSON after they are produced.
Compatibility
Quick start
Use cases
Alternatives
Featured in these lists
Comments
No comments yet. Be the first!