Ever looked at your Claude Code API bill and thought “this is getting ridiculous”? Yeah, me too. A few weeks of heavy agent usage and suddenly you’re spending more on tokens than on the VPS hosting everything else. I hit that point last month — $187 in API costs from a single weekend of aggressive agent loops.

So when I saw Headroom hit 57,706 GitHub stars (up from 13,784 when I first covered it in June — that’s 4× growth in 33 days), I knew I had to revisit it. The pitch? Compress everything your agent sends to the LLM by 60–95% without changing a line of code. No new architecture. No rewriting your agent loops. Just plug it in and save.

Here’s the short version: it works. So I installed it, wrapped it around Claude Code, and my per-query token counts dropped by 73–92% on the workloads I tested. Plus, the project has matured significantly since my last review — new ML models, proper MCP Server integration, and clean Docker support for team deployments.

What’s New Since June

The project has moved from a solo creator (chopratejas/headroom) to a proper organization (headroomlabs-ai/headroom). That’s a big signal — it’s not a side project anymore. Here’s what changed:

  • Kompress-v2-base — a dedicated ML model for general text compression, trained specifically for this use case. Not a generic gzip — an actual transformer that understands semantic preservation.
  • ContentRouter improvements — the auto-detection of JSON, code, and plain text is noticeably sharper. I threw mixed workloads at it (code search results + JSON tool output + log dumps) and it picked the right strategy every time.
  • Proper MCP Serverheadroom mcp serve exposes compress + retrieve as MCP tools. Any MCP-compatible client gets compression for free.
  • Docker support — official Docker images for proxy deployment. This is what unlocks the VPS deployment scenario.

But the core value prop hasn’t changed: zero-code compression that doesn’t sacrifice accuracy.

Quick Start (60 Seconds to Savings)

Installation takes about 20 seconds:

uv tool install "headroom-ai[all]"

Or if you’re still on pip:

pip install "headroom-ai[all]"

Wrap your agent:

headroom wrap claude

That’s it. Now run headroom doctor to verify the routing, then start using Claude Code normally. Every input gets compressed before hitting the API. The wrap command intercepts the CLI tool’s config, so there’s nothing else to configure.

For the proxy approach — useful if you have multiple tools or want to share compression across your team:

headroom proxy --port 8787
# Point any OpenAI-compatible client at http://localhost:8787/v1

The Numbers I Actually Saw

Still, Headroom publishes official benchmarks on their docs, but I ran headroom perf against my own workloads to verify. Here’s what I measured on a Ryzen 9 7950X with 64GB RAM:

Workload Raw Tokens Compressed Savings
Code search (100 results) 17,765 1,408 92%
SRE incident debugging 65,694 5,118 92%
GitHub issue triage 54,174 14,761 73%
Codebase exploration 78,502 41,254 47%
My Django project (mixed) 32,109 13,946 57%

But the savings vary by workload type. Even so, JSON-heavy tool outputs compress best (the SmartCrusher strategy targets 70–92% there). Plain code exploration is less compressible — you’re getting ~47% which is still meaningful. What surprised me: even at 47%, the LLM’s answers didn’t degrade. I spot-checked a few outputs and they were functionally identical.

On the accuracy benchmarks, Headroom holds its ground:

Benchmark Baseline Headroom Δ
GSM8K (Math) 0.870 0.870 ±0
TruthfulQA (Factual) 0.530 0.560 +0.030
BFCL (Tool Calling) 97% at 32% comp.
SQuAD v2 (QA) 97% at 19% comp.

Now, the TruthfulQA improvement is not a fluke — stripping noise genuinely helps the LLM focus. I tested this directly on an SRE debugging benchmark where the compressed version caught a root cause the baseline version missed.

How It Compares (Headroom vs tokdiet vs Manual)

Token compression isn’t a new space. I covered tokdiet a few weeks back — a lighter-weight approach. Here’s how they stack up:

Feature Headroom tokdiet Manual Prompt Optimization
Compression Rate 60–95% (JSON) / 15–20% (Agent) Similar range Depends on skill
Auto Content Detection ✅ ContentRouter ❌ No type detection ❌ You do it manually
Code AST Compression ✅ Yes ❌ No ❌ No
Reversible Compression (CCR) ✅ Full retrieval ❌ No ❌ No
Proxy Mode (Zero Code) ✅ Yes ✅ Yes ❌ Requires rewriting
MCP Server ✅ Yes ❌ No ❌ No
Cross-Agent Shared Memory ✅ Yes ❌ No ❌ No
Output Token Control ✅ Yes ❌ No ❌ No
GitHub Stars 57.7k★ ~5k★

Headroom wins on feature completeness. tokdiet is a solid concept prototype — the proxy mode works fine for basic use. But Headroom’s reversible compression (CCR), MCP integration, and cross-agent memory make it production-grade. You’re not giving anything up by using the more mature tool.

Deploying Headroom on a VPS (For Your Whole Team)

Here’s where it gets interesting. Headroom runs fine locally — the wrap approach is great for individual use. But if you want a shared compression proxy for your team, you can deploy it on a VPS in about 10 minutes — Vultr offers a $100 trial credit to get started (affiliate link).

This is what I did on a $6 DigitalOcean Droplet ($200 free credit for new users). The Docker Compose setup is clean:

# docker-compose.yml
version: '3.8'
services:
  headroom:
    image: ghcr.io/headroomlabs-ai/headroom:latest
    ports:
      - "8787:8787"
    volumes:
      - headroom_data:/data
    environment:
      - HEADROOM_PORT=8787
      - HEADROOM_STORE=/data
    restart: unless-stopped

volumes:
  headroom_data:

Then SSH into your VPS and run:

docker compose up -d

So every developer on your team points their OpenAI-compatible client at http://your-vps-ip:8787/v1 — and they all get compression transparently. The shared memory store means one agent’s learnings benefit the whole team.

In practice, it took me about 8 minutes from “create droplet” to “first compressed request.” The compression adds maybe 200ms of latency — negligible compared to the LLM response time.

Heads up: the 92% compression you see on code search doesn’t apply everywhere. Your mileage depends on workload type. JSON-heavy = huge savings. Free-form conversation = more modest. Set expectations accordingly.

Also worth noting: the project is evolving fast — 57k stars and commits every few hours. Yet features you rely on today might get deprecated tomorrow. That said, the core proxy + wrap functionality has been stable across the last several releases.

Who Should Use This

  • Daily Claude Code / Codex / Cursor users — this directly cuts your API spend. One install, immediate savings.
  • MCP ecosystem developersheadroom mcp serve gives any MCP client compression for free.
  • Teams sharing an agent setup — deploy the proxy on a $6 VPS and everyone saves.
  • LangChain / custom pipeline builders — the library mode integrates into Python or TypeScript pipelines.

Skip it if you’re happy with a single provider’s native caching (Claude’s prompt caching works fine for Anthropic-only workflows) or if you work in an environment where installing local binaries isn’t allowed.

The Bottom Line

Headroom went from “promising side project” at 13k stars to “57k-star infrastructure” in just over a month. The ML-based compression is real, the reversible CCR feature means you’re not trading accuracy for savings, and the VPS deployment path makes it viable for teams.

pip install headroom-ai[all] and headroom wrap claude — two commands, 60 seconds. Worst case you’re out a minute. Best case you cut your API bill in half.

I’ve been running it for three days now. My Claude Code costs dropped from ~$187/weekend to roughly $65. No degradation in output quality. That’s not a bad return on a 60-second setup.

Disclosure: Some links below are affiliate links. If you sign up through them, I may earn a commission at no extra cost to you.