Headroom: a tool that compresses AI agent input before it reaches the LLM
Headroom is a tool published as headroom-ai on PyPI and npm. It compresses what an AI agent reads before the text is sent to a large language model (LLM[1]). Tool outputs, logs, RAG[2] chunks, files and conversation history are compressed, and according to the README the answers stay the same while input tokens go down. Compression runs on the user's machine, and no prompt or file content is sent anywhere for compression.
The README reports 21–57% fewer input tokens across four agent scenarios, over 90% fewer for repeated JSON arrays and log lines, and little reduction for prose. Headroom can be used as a library for Python or TypeScript, as a proxy started with `headroom proxy --port 8787`, or as an MCP[3] server. The command `headroom wrap` launches coding agents such as Claude Code, Codex and Cursor through Headroom without code changes.
Originals are cached locally by CCR[4], so the model can retrieve the full text when it needs it. Headroom also includes a shared memory store for several agents with automatic deduplication. The `headroom learn` command writes corrections from failed sessions into agent instruction files, and the tool also reduces the output tokens the model writes back, not only the input.
Sources
-
GitHub Trending
headroomlabs-ai/headroom


