FormingConfigclaude-codecodexcursoropencodepublished fresh until

Headroom: how do I cut my coding agent's token bill?

Summary Headroom is an open-source (Apache 2.0) local proxy and library that compresses what your agent reads (tool results, logs, JSON, files) before it reaches the model, keeping originals locally so the model can fetch them back. As of October 2026 its README reports about 20% fewer tokens for coding agents and more on repetitive JSON and logs.

Not for writing better prompts or trimming system prompts and skills

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
AConfig · v0.41.0+wwfix.1Headroom token compression proxy
How you use itA setting in your project
What it can doinstalls software · writes files · network · secrets access · runs shell
What's inside
AConfig · v0.41.0+wwfix.1Headroom token compression proxy
How you use it
A setting in your project
What it can do
installs software · writes files · network · secrets access · runs shell
What's inside

What this thread does

As of November 2026, Headroom still compresses agent input locally, but reports from older builds qualify its retrieval guarantees (HetCreep, 29 October). Do first: check that exact content can be retrieved in your client before relying on compression for sensitive details.

What it is

Headroom (headroomlabs-ai/headroom, formerly chopratejas/headroom, Apache 2.0) sits between your agent and the LLM API. It detects the content type and compresses it with a matching method: JSON arrays, source code (AST-aware), and prose (a small local model). Originals are cached on your machine and the model gets a headroom_retrieve tool to pull the full text when it needs it. Compression runs locally; prompts and files are not sent to Headroom's servers.

You can use it as:

  • headroom wrap claude (also codex, aider, opencode, cline, copilot and others), which starts a local proxy and launches the agent through it. Cursor needs manual setup with the proxy URL;
  • headroom proxy --port 8787 for any app;
  • a Python or TypeScript library, or an MCP server.

It was shared on X by @BharukaShraddha (7 September 2026).

Numbers (as stated by the project)

The README's offline, seeded scenarios show 21% to 57% fewer tokens (code search 21%, GitHub issue triage 30%, codebase exploration 42%, incident debugging 57%), and over 90% on highly repetitive JSON arrays and log lines. Dense prose barely compresses. Its accuracy table shows no detectable change on GSM8K and TruthfulQA at N=100. Run headroom savings on your own traffic; your number depends on how repetitive your tool output is.

When to use it

When most of your spend is input tokens from big tool results: logs, test output, API or database JSON, search results. If your sessions are mostly short prompts and code edits, expect little gain.

Alternatives: trimming MCP tool output at the server, your harness's own compaction, or a leaner harness (see the harness-choice thread).

Caveats

  • headroom wrap installs the Serena MCP server for the wrapped project only if you pass --code-memory serena (off by default). Undo wrapping with headroom unwrap <tool>.
  • An anonymous usage beacon is on by default (compression ratios, model IDs, OS; no prompts or code). Turn it off with HEADROOM_BEACON=off or DO_NOT_TRACK=1.
  • With OpenCode or another OpenAI-compatible client pointed at a non-OpenAI provider (DeepSeek, OpenRouter), pass --openai-api-url when wrapping, or your provider key is sent to OpenAI's default upstream and rejected.
  • headroom learn can write notes into CLAUDE.local.md or CLAUDE.md; review before committing.
  • Optional output shaping (HEADROOM_OUTPUT_SHAPER=1, off by default) changes the system prompt and reasoning effort. Test it on your own tasks first.
  • Compression can drop a detail the model needed. The retrieve tool helps, but check results on tasks where exact output matters. Retrieval is not guaranteed: HetCreep reported protected-tag content missing from both compressed output and the stored original in issue #4542 (29 October 2026, main source with a 0.42.0 Rust core). As checked 2026-11-14, it was closed on 2026-11-05 by merged PR #4543; the repair is listed in v0.43.1. carminefa reported a Cline retrieval loop with headroom__headroom_retrieve in issue #4585 (30 October, headroom-ai 0.42.0, token proxy mode). As checked 2026-11-14, it was closed on 2026-11-04 by merged PR #4586; a containing release is not established here. These are upstream user reports, not WhatWorks trials.

Sources

Checked against the primary source, the Headroom README and repository metadata (Apache-2.0; the repo is now headroomlabs-ai/headroom and the old chopratejas/headroom path resolves to it): headroom wrap for many agents with headroom unwrap to undo, headroom proxy --port 8787, an MCP server with headroom_retrieve, Cursor listed as manual setup, local runs with originals cached locally, the benchmark table (code search 21%, issue triage 30%, codebase exploration 42%, incident debugging 57%), the GSM8K and TruthfulQA table at N=100 (the README says a TruthfulQA delta of 0.03 is inside the confidence interval), Serena installed on wrap only with --code-memory serena (off by default), the default-on anonymous beacon and its off switches, the --openai-api-url footnote for third-party OpenAI-compatible providers, headroom learn writing to CLAUDE.local.md by default, and HEADROOM_OUTPUT_SHAPER off by default.

Not checked here: the X post by BharukaShraddha (not opened), the AST-aware and small-local-model details of the compressors, and the figure of "over 90%" beyond the README's one-line statement about repetitive content (the README points to a latency benchmark script). Numbers are the project's own, not independently reproduced.

Not for: writing better prompts or trimming system prompts and skills

checked 2026-11-03

Started from a post by @BharukaShraddha, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Headroom: how do I cut my coding agent's token bill?
Summary: Headroom is an open-source (Apache 2.0) local proxy and library that compresses what your agent reads (tool results, logs, JSON, files) before it reaches the model, keeping originals locally so the model can fetch them back. As of October 2026 its README reports about 20% fewer tokens for coding agents and more on repetitive JSON and logs.

## Options
- A · Headroom token compression proxy · early, no verdict yet · installs software · writes files · network · secrets access · runs shell
Copy for agent
get the whatworks thread headroom-compress-agent-tokens and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread headroom-compress-agent-tokens

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Headroom token compression proxy

Local proxy, library and MCP server that compresses tool outputs, logs, JSON and files before they reach the LLM and keeps originals for on-demand retrieval. `headroom wrap claude` routes Claude Code through it. Apache 2.0, Python 3.10+.

Format
Config
Source
github:headroomlabs-ai/headroom
Pinned
v0.41.0+wwfix.1 · 76133cff59b7
Content hash
76133cff59b71284
Audit
scan warned
Can do
installs software · writes files · network · secrets access · runs shell
Works with
claude-code · codex · cursor · opencode · cline · aider
Check
headroom-ai 0.41.0 is installed in the project's .venv; The headroom CLI runs; While the proxy runs (headroom proxy or wrap), it answers on port 8787
Author
@chopratejas
Kudos
0
Are you @chopratejas? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package headroom before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package headroom
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp