How to install · MCP setup · Download source (ZIP)
Headroom reduces long logs, search results and other data before a model works with them. It helps when repetitive output occupies context while the task needs only a small part of it.
What it is useful for
For example, a long build log contains one error, its timestamp and file path. Headroom can reduce repetitive lines while keeping the original available for retrieval. A short question or already-dense text may not benefit from another tool.
The modes differ: the Python library runs inside a program; MCP exposes compression and retrieval tools; the proxy forwards model requests; wrap configures and launches an agent through the proxy. MCP needs no proxy and does not automatically compress all traffic. For a first trial, choose MCP only without changing the model, memory or working client.
How to install and connect MCP
The official documentation provides a separate dependency set for MCP. uv installs it in an isolated application environment:
uv tool install --python 3.13 "headroom-ai[mcp]"
Before running it, the assistant checks the OS, architecture, uv, Python, existing installations and compatible packages. Python 3.10+ is the package minimum; 3.13 is used in the recommended CLI route. Installation and first startup may download dependencies or models. Do not replace system Python or disable certificate checks to make installation work. If incompatible, find a suitable official route for that platform first.
After agreement, Codex finds the absolute headroom path and registers a local stdio MCP server with arguments mcp, serve. A bare command name may fail when the client cannot see uv's directory on PATH. The documented headroom mcp install command configures Claude Code; it is not universal Codex registration.
The client should expose headroom_compress, headroom_retrieve and headroom_stats. A tool listing does not prove compression. The npm headroom-ai package is a TypeScript SDK, not the CLI; do not install it instead of the Python command. This route needs neither a proxy nor automatic wrapping.
How to test compression on a copy
- Codex prepares a separate practice log with repetitive lines and one exact error, such as FATAL in src/form.ts with a dummy timestamp. It saves the original separately from the result. Real keys and customer logs are unnecessary for the first test.
- Once connected, it calls headroom_compress on a copy. It shows before/after size, applied transforms and the retrieval key. It compares the error, path and timestamp with the original. If no reduction occurs, it checks input size and type rather than forcing a higher percentage.
- The assistant calls headroom_retrieve with the returned key and compares the full text with the saved original. It checks the same task against both versions and compares the actual answers. It asks you to agree on any extra model calls and their cost first.
The important question is whether the necessary fact remains available, not just how many tokens were removed. If a detail is missing, retrieve it rather than guessing. Retrieving full text also adds context.
How to assess savings and storage
The original-content cache has retention and capacity limits. MCP documentation gives a default one-hour lifetime for its local store; the proxy has separate settings, normally 30 minutes. Check effective values for your version. After expiry or cache deletion, a key cannot replace a file, so save the practice original separately. This is not a project archive or backup.
Compression runs locally, but proxy requests still go to the chosen model provider. The project documents numeric telemetry enabled by default, with HEADROOM_BEACON=off and DO_NOT_TRACK=1 to opt out. Choose the intended mode, check downloads and storage before the trial, and keep the local server private.
Compare total usage, answer quality and latency on identical inputs. headroom_stats describes tool activity, not savings across an entire subscription. Frequent MCP calls add context themselves. Another workload's compression percentage and an estimated cost figure are not your measured usage.
If you later need wrap, review its changes separately: it can start a proxy, add Serena for code navigation and reroute requests. Check the provider endpoint, authentication, existing proxies and restoration method. headroom learn reads past sessions and can write rules; it is a separate action, not required compression setup.
What you get and how to disable it
The trial produces a saved original, a compressed copy, checked key facts and working full-text retrieval. Continue with the log in fixing a project bug. If remembering decisions between sessions matters more, explore Claude-Mem separately instead of combining its installation with Headroom.
For MCP, disable only the selected client entry and stop its own process. Review cache and saved files separately. If Codex wrapping was enabled, the documented headroom unwrap codex route requires inspecting which settings it restores. Do not delete shared MCP configuration or stop someone else's proxy. Disconnecting does not automatically remove all stored data.
Prompt for Codex
Paste into Codex with access to a practice project:
Help test Headroom on a dummy long log without rerouting my working model. Find the project, rules, existing installation and MCP configuration. Read the current README and MCP documentation linked from https://github.com/headroomlabs-ai/headroom.
Choose the minimal Python CLI with MCP through uv and Python 3.13 if suitable for my OS. Check versions, dependencies and the absolute executable path. Show installation changes, downloads, storage and network activity, then wait for agreement. Do not replace system Python or disable certificate verification.
If a connection is needed, after agreement register one local stdio MCP server using the discovered absolute headroom path and mcp serve arguments. Do not use Claude's install command as Codex registration. Do not add wrapping, a proxy, Serena, shared memory or learning from old sessions for this trial.
Create a practice log with repetitive content and one exact error, path and timestamp, saving the original. Compress a copy with headroom_compress. Show whether those facts survived and the before/after size. Retrieve full text with headroom_retrieve using the real returned key and compare it with the original.
Check an answer to the same task against both versions using available capabilities. Agree separately on additional model requests. Do not invent savings or treat an MCP listing, short text or statistics as proof of a correct answer.
Show actual results, cache retention and how to disable only this connection. Do not delete the saved original, other MCP servers, shared settings or unrelated processes. Identify anything that could not be checked.