Expert guide for installing, configuring, and using Headroom — the context compression layer for AI agents. Use this skill whenever the user mentions Headroom, token compression, context compression, reducing LLM token costs, headroom-ai, headroom proxy, headroom wrap, CCR reversible compression, Kompress-base, SmartCrusher, CodeCompressor, CacheAligner, cross-agent memory, headroom learn, or output token reduction. Also trigger when the user asks how to make AI agents cheaper, how to reduce context window usage, how to share memory between Claude/Codex/Gemini, or how to set up a drop-in compression proxy for any LLM client. Even if they just say "compress my prompts" or "save tokens with my agent" — use this skill.
Ships in general. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Headroom is a local-first context compression layer: it sits between your agent/app and the LLM provider, compresses everything (tool outputs, RAG chunks, logs, files, conversation history), and passes smaller prompts to the model. Same answers, 60–95% fewer tokens.
Agent / App
│ (tool outputs · logs · RAG · files · history)
▼
Headroom (runs locally — data never leaves)
│ CacheAligner → ContentRouter → CCR
│ ├─ SmartCrusher (JSON)
│ ├─ CodeCompressor (AST)
│ └─ Kompress-base (text, HuggingFace)
▼
LLM Provider (Anthropic · OpenAI · Bedrock · …)
# Python (everything)
pip install "headroom-ai[all]"
# TypeScript / Node
npm install headroom-ai
# Docker
docker pull ghcr.io/chopratejas/headroom:latest
Python 3.10+ required. Granular extras: [proxy], [mcp], [ml],
[code], [memory], [relevance], [image], [agno], [langchain],
[evals], [pytorch-mps].
Using pipx?
pipx install --python python3.13 "headroom-ai[all]"
headroom update # auto-detects pip/pipx/uv and upgrades in place
headroom update --check # report latest version without upgrading
headroom update --pre # include pre-releases
headroom wrap claude # Claude Code
headroom wrap codex # OpenAI Codex
headroom wrap cursor # Cursor (prints config to paste)
headroom wrap aider # Aider
headroom wrap copilot # GitHub Copilot CLI
headroom wrap opencode # OpenCode
One command — Headroom starts the proxy and launches the agent with compression transparently applied.
headroom proxy --port 8787
Point any OpenAI-compatible client at http://localhost:8787. Works with any
language, any framework.
headroom dashboard # live savings dashboard (proxy must be running)
from headroom import compress
compressed = compress(messages, model="claude-opus-4-5")
# Pass compressed to your LLM call
import { compress } from "headroom-ai";
const compressed = await compress(messages, { model: "claude-opus-4-5" });
headroom mcp install
Exposes headroom_compress, headroom_retrieve, headroom_stats to any MCP
client.
| Setup | How to hook in |
|---|---|
| Python app | compress(messages, model=…) |
| TypeScript app | await compress(messages, { model }) |
| Anthropic SDK | withHeadroom(new Anthropic()) |
| OpenAI SDK | withHeadroom(new OpenAI()) |
| Vercel AI SDK | wrapLanguageModel({ model, middleware: headroomMiddleware() }) |
| LiteLLM | litellm.callbacks = [HeadroomCallback()] |
| LangChain | HeadroomChatModel(your_llm) |
| Agno | HeadroomAgnoModel(your_model) |
| ASGI apps | app.add_middleware(CompressionMiddleware) |
| Multi-agent | SharedContext().put / .get |
| MCP clients | headroom mcp install |
Headroom stores originals locally. If the LLM needs the full original, it calls
headroom_retrieve. Compression is never lossy without a way back.
Configure TTL and storage path via HEADROOM_CCR_TTL and HEADROOM_CCR_PATH.
from headroom.memory import SharedContext
ctx = SharedContext()
ctx.put("key", value) # store from any agent
result = ctx.get("key") # retrieve from any agent
Works across Claude, Codex, Gemini. Auto-deduplicates. Persists across sessions.
Reduces what the model writes back (not just what you send). Useful on Opus-class models where output costs 5× input.
export HEADROOM_OUTPUT_SHAPER=1
headroom proxy --port 8787
Adds verbosity steering and effort routing. Measure savings:
headroom output-savings
# Reduction: 31.7% (95% CI 27.7% … 35.7%) [estimated]
For measured (vs. estimated) savings, use a holdout control group:
export HEADROOM_OUTPUT_HOLDOUT=0.1
Learn the right terseness automatically from past sessions:
headroom learn --verbosity # preview (dry run)
headroom learn --verbosity --apply # save and apply
headroom learn — Failure MiningMines failed agent sessions and writes corrections to CLAUDE.md /
AGENTS.md / GEMINI.md.
headroom learn
| Workload | Before | After | 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% |
Accuracy is preserved: GSM8K ±0.000, TruthfulQA +0.030, SQuAD v2 97% at 19% compression, BFCL tools 97% at 32% compression.
Reproduce: python -m headroom.evals suite --tier 1
headroom copilot-auth login
headroom wrap copilot --subscription -- --model gpt-4o
For GitHub Enterprise Server:
export GITHUB_COPILOT_ENTERPRISE_DOMAIN=ghe.example.com
headroom wrap copilot --subscription
See references/troubleshooting.md for:
CERTIFICATE_VERIFY_FAILED)cdn.pyke.io)What SKILL.md sets; muted values are Claude Code's defaults
/general:headroomfrom general
npx claudepluginhub jaybondholliete/skill --plugin general18 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/executing-plansUse when you have a written implementation plan to execute in a separate session with review checkpoints/find-skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill./finishing-a-development-branchUse when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup/receiving-code-reviewUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationOther plugins' skills for the same job