Claude Code model router

Headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

78,728 stars 6,152 forksModel routers & proxies Plugin marketplace Source

Install

Add the plugin marketplace
/plugin marketplace add headroomlabs-ai/headroom

Run inside Claude Code, then /plugin to pick what to install from it.

Install
brew install python@3.13  # if 3.13 is not already available

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/headroomlabs-ai/headroom.git

From the README

Quickstart ·
  Headroom for Teams ·
  Install ·
  Proof ·
  Agents ·
  Docs ·
  Discord ·
  llms.txt

AI agents / LLMs: read /llms.txt here, or fetch
the live index ·
full docs blob.

Headroom compresses everything your AI agent reads — tool outputs, logs, RAG
chunks, files, and conversation history — before it reaches the LLM. Same
answers, fraction of the tokens. Compression runs on your machine; no prompt or
file content is sent anywhere to be compressed.

  10,144 → 1,260 tokens. The same FATAL found.

What it does

- Library — compress(messages) in Python or TypeScript, inline in any app.
- Proxy — headroom proxy --port 8787, zero code changes, any language.
- Agent wrap — headroom wrap claude|codex|grok|copilot|cursor|aider|opencode|cline|continue|goose|openhands|openclaw|vibe|omp|zcode in one command; undo with headroom unwrap .
- MCP server — headroom_compress, headroom_retrieve, headroom_stats for any MCP client.
- Cross-agent memory — one shared store across Claude, Codex, Gemini and Grok, with automatic dedup.
- headroom learn — mines failed sessions and writes corrections to CLAUDE.local.md (default, gitignored), CLAUDE.md, AGENTS.md, GEMINI.md or GROK.md.
- Output token reduction — trims what the model *writes back*, not only what you send. See below.
- Reversible (CCR) — originals are cached locally and retrieved on demand.

How it works

- ContentRouter detects the content type and selects a compressor for it.
- SmartCrusher / CodeCompressor / Kompress-v2-base handle JSON, source code and prose respectively.
- CacheAligner flags volatile content that would bust a provider KV-cache prefix. It never rewrites prompts.
- CCR stores originals locally so the model can call headroom_retrieve when it needs the full text.

→ Architecture ·
CCR ·
Kompress-v2-base…
Read the full README on GitHub

Details

Language
Python
License
Apache-2.0
Last updated
3 November 2026
Topics
agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcp

FAQ

What is Headroom?

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server. It is a model router for Claude Code, from headroomlabs-ai/headroom on GitHub.

How do I install Headroom?

Run brew install python@3.13 # if 3.13 is not already available, then follow the setup in the README.

Is Headroom popular?

headroomlabs-ai/headroom has 78,728 GitHub stars and 6,152 forks, and is included in 1 curated Claude Code list. It was last updated on 3 November 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.