Compresses tool outputs, logs, files and RAG chunks before they reach the LLM
open coreApache-2.0self-hostablefreeMCP
Headroom compresses what an AI agent reads (tool outputs, logs, RAG chunks, files and conversation history) before it reaches the model, so the same answers cost fewer input tokens; its README measures 21–57% fewer on four agent scenarios and 90%+ on repeated JSON arrays and log lines. It routes each kind of content to a compressor for JSON, source code or prose, keeps originals locally so the model can retrieve them, and runs on your machine. It works as a Python or TypeScript library, a local proxy, a one-command wrapper for coding agents such as Claude Code and Codex, or an MCP server, and adds cross-agent memory. Its makers sell Headroom Enterprise for teams.
Problems it solves
- my coding agent burns through tokens reading huge tool outputs and logs
- cut my LLM bill when my app sends big JSON API responses to the model
- shrink RAG chunks and file contents before they hit the context window without changing my agent
Features
- compress() library for Python and TypeScript
- local proxy with zero code changes
- headroom wrap for Claude Code, Codex, Cursor, Aider, OpenCode, Cline and more
- MCP server with compress, retrieve and stats tools
- reversible compression: originals cached locally and retrieved on demand
- cross-agent memory shared by Claude, Codex, Gemini and Grok
- headroom learn writes corrections from failed sessions to CLAUDE.md or AGENTS.md
- output token reduction
Limitations
- An anonymous telemetry beacon is on by default (compression ratios, counters, provider and model IDs, OS); it can be turned off with HEADROOM_TELEMETRY=off or DO_NOT_TRACK=1.1
- Saves little on short conversational prompts and prose.1
- The headroom CLI and proxy ship only in the PyPI package; the npm package is the TypeScript SDK alone.1
Ways to run it
Headroom (open source)
free1
Only in this edition
- library, proxy, agent wrap, MCP server, cross-agent memory and headroom learn
You arrange
- the LLM provider and agents it sits in front of
Headroom Enterprise
contact sales1
Only in this edition
- more cost savings, token security, on-premise deployment and deep attribution, per the README
You arrange
- a conversation with Headroom Labs
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Has an MCP server | plan not known |
| Has official SDKs | plan not known |
Alternatives
The same job
These do what Headroom does.
- RTK (Rust Token Killer) Cuts the command output AI coding agents read
- Caveman Skill and local proxy that make coding agents answer shorter and read smaller tool output
- code-review-graph Local code knowledge graph that gives AI coding tools precise review context over MCP
- Context Mode Local plugin that keeps coding agents' tool output out of their context window, with sandboxed runs and SQLite search