Headroom: The Context Compression Layer for AI Agents

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM, saving 15-20% tokens for coding agents and 60-95% for JSON, with identical answers.

Stars
★ 81k
Last updated
1d ago v0.45.0
FARS reviewed
Nov 07, 2026 +2 new
License
Apache-2.0
Primary language
Python

At a glance

How it runs
CLILibrary / SDKSelf-hosted service
Works with
Universal · cross-platformCodex · Claude Code · OpenAI API · Claude API
Cost
Free software; you pay for model usage
Setup effort
Medium · a few setup steps
You'll need
Python 3.10+Node.js 18+ (for TS SDK)Shell / CLINetwork accessLocal filesystem
Typical use
A developer using Claude Code or Cursor daily wants to reduce context tokens for tool outputs by 15-20% without changing answers.
Not a fit if
  • Teams happy with one provider's native compaction and no cross-agent memory
  • Sandboxes where local processes cannot run
  • Short chats or already-dense payloads that see little reduction
Website
docs.headroomlabs.ai/docs ↗ set on GitHub
Maintenance
Commits in the last 30 dayslast commit 2026-12-02latest release v0.45.0 (2026-11-22)+75.9 ★/day over 7 days
Source review
71/100 · Some gaps

What does this agent do, and when should you use it?

Headroom is a local-first context compression layer for AI agents that reduces the number of tokens sent to an LLM without changing the answers. It provides Python and TypeScript libraries, a drop-in proxy, an MCP server, and cross-agent memory. The core pipeline uses a ContentRouter to detect content type, then compresses with SmartCrusher for JSON, CodeCompressor (AST-aware) for code, and Kompress-v2-base for prose. Compression is reversible via a CCR mechanism that caches originals locally, retrievable on demand. The project supports integration with coding agents like Claude Code, Codex, Copilot, and Cursor through a proxy, and transparently handles Anthropic and OpenAI-compatible APIs. It also includes headroom learn to mine failed sessions and write corrections to memory files like CLAUDE.md.

Headroom performs several concrete operations before content reaches the LLM. As a library, it offers compress() to process messages directly. As a proxy, headroom proxy --port 8787 runs a drop-in proxy for any client. As a wrapper, headroom wrap claude launches a local proxy, installs semantic code navigation via Serena, and configures the agent to route through Headroom. It uses a ContentRouter to classify input, then compresses with SmartCrusher (JSON), CodeCompressor (AST), or Kompress-v2-base (text). Output-side token reduction includes verbosity steering and reduced thinking effort, enabled via HEADROOM_OUTPUT_SHAPER. It serves an MCP server with tools like headroom_compress, headroom_retrieve, and headroom_stats. It mines failed sessions with headroom learn and writes corrections to CLAUDE.md, AGENTS.md, or GEMINI.md.

  1. A developer using Claude Code or Cursor daily wants to reduce context tokens for tool outputs by 15-20% without changing answers.
  2. An SRE dealing with huge JSON responses uses SmartCrusher to achieve 60-95% token reduction.
  3. A RAG pipeline engineer compresses large document chunks before sending them to the LLM.
  4. A team using multiple agents (Claude, Codex, Gemini) shares memory across them with cross-agent memory.
  5. A CI environment runs coding agents and wants to cut token costs for automated workflows.
  6. A developer integrates with Anthropic or OpenAI APIs transparently via the proxy or SDK adapters.

How do you install or deploy this agent?

Headroom installs as a Python tool via pip or uv, with a TypeScript SDK. The Python CLI provides full features; the TypeScript SDK is library-only.

How do you use this agent?

After installation, run Headroom in your preferred mode. Start a zero-code proxy with headroom proxy --port 8787. Wrap a coding agent with headroom wrap claude. Use headroom deploy for a turnkey setup. Verify with headroom doctor.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

FARS trust-control audit

Verified present in source (3/3)
  • data-flow disclosure

What are this agent's strengths and limitations?

Pros
  • Local-first and reversible: data stays on your machine, and originals are retrievable via CCR.
  • Content-aware compression: uses specialized compressors for JSON, code, and text.
  • Agent-agnostic: supports Claude Code, Codex, Copilot, Cursor, and more via proxy and OpenAI compatibility.
  • Output-side token reduction: shrinks what the model writes back, including verbosity steering and thinking budget cuts.
  • Cross-agent shared memory: shares context across multiple agents with automatic deduplication.
Limitations
  • Setup overhead: wrapping an agent requires a local proxy and configuration, which may require debugging.
  • Python version requirements: needs Python 3.10+ but 3.13+ for full dollar savings with LiteLLM.
  • CPU requirement: x86 hosts need AVX2 for ONNX-backed features, limiting some older VMs.
  • Performance overhead: compression adds latency to each request.
  • Documented limitations: some paths are noted as smoke-tested but not fully validated (e.g., Windows/Linux credential storage).

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Headroom: The Context Compression Layer for AI Agents This agent 71 · Some gaps CLIFree + model costs ★ 81k 1d ago Python Codex · Claude Code · OpenAI API · Claude API
AOCI-CODE — a Git-versioned cognition index for coding agents 82 · Good CLIFree + model costs ★ 3.2k today Go Codex · Claude Code
lcc — Local Context Compiler 77 · Good CLIFree ★ 20 today Python Claude Code
Loop Engineering 65 · Some gaps CLIFree + model costs ★ 12k 1d ago TypeScript Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Some gaps
71/ 100 5-point scale 3.6 / 5
This review covers the source as of Nov 07, 2026. The project has shipped 2 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 17/29
Reliability 9/14
Adaptability 16/18
Convention 15/18
Effectiveness 9/13
Verifiability 5/8
Why each dimension lost points
Trust17 / 29 · 2.9/5

The materials say the base compressor runs in-process and HEADROOM_OFFLINE blocks Headroom's own network calls; the proxy and MCP beacon is enabled by default and can be disabled with HEADROOM_BEACON=off. SECURITY.md specifically discloses plaintext cached content, some persisted credentials, logging, and local-admin boundaries, supporting a high data-flow transparency score. Plaintext content storage, the default beacon, and the lack of demonstrated per-action confirmation or a complete recovery flow reduce other scores. Dependency metadata gives version floors and mitigations for named issues, but is not a complete dependency audit. Publisher identity is unverified; repository attribution is present but does not establish who actually maintains it.

Reliability9 / 14 · 3.2/5

README, skill files, and package metadata mostly agree on primary usage, Python version, and package naming; AGENTS.md also distinguishes compress() for provider callers from server-side ASGI middleware. The example and CLI source provide some failure-handling evidence, but static materials cannot establish runtime behavior. The evaluation CLI prints and continues after some per-dataset exceptions, so ordinary reliability and error-message handling receive moderate scores.

Adaptability16 / 18 · 4.4/5

The files cover Python library, TypeScript SDK, proxy, MCP, and several coding-agent scenarios, with specific applicability triggers. The skill specifies which message roles are compressed by default, that user messages remain untouched, that TypeScript requires the Python proxy, and when the ASGI middleware applies; capability boundaries and trigger precision are therefore strong. The base install is lightweight, but proxy, ML, and memory options add dependencies and environment requirements, so broad environment fit is not fully established.

Convention15 / 18 · 4.2/5

The README, skills, package metadata, license, and security policy give clear installation paths, disambiguate package names, describe optional extras, identify supported versions, and document limitations. A full Apache-2.0 license is included. The changelog is generated by release-please and version-sync scripts are described, but this sample does not include actual release history. Maintenance is attributed to Contributors/Maintainers and a security contact is given, but organizational identity is unverified, so responsibility receives a moderate score.

Effectiveness9 / 13 · 3.5/5

The output retains the input message shape and reports before/after token counts; originals can be retrieved from a local cache. Examples claim preservation of errors, stack traces, and outliers. The README bounds savings claims to named agent scenarios and repeated JSON/log data, with less benefit on prose; the skill says not to promise a percentage. These claims have useful boundaries, but were not executed here, and caching, proxy use, and optional dependencies add costs, so utility and cost-benefit receive moderate scores.

Verifiability5 / 8 · 3.1/5

The materials provide a reproducible command, benchmark documentation pointers, result fields, an evaluation CLI, CI configuration, and specific data-handling disclosures in the security policy; README, skills, and metadata corroborate some claims. Savings figures remain repository assertions, and the referenced benchmark contents are not in this evidence packet. CI configuration describes a test process but does not prove that this revision passed. Claims and limitations are partly separated, but independent corroboration is limited, so these criteria do not receive full marks.

Risks and how to mitigate them
  • Compressed originals are cached as unencrypted plaintext; the materials suggest HEADROOM_CCR_BACKEND=memory when disk persistence is unacceptable.
  • The proxy and MCP send an anonymous beacon by default; review telemetry policy and set HEADROOM_BEACON=off or HEADROOM_OFFLINE=1 where appropriate.
  • The security policy says settings, install configuration, logs, and the Copilot OAuth file may contain sensitive data; restrict access and enable content logging carefully.
  • Token-savings and answer-preservation claims were not run or verified in this static review.
Evidence confidence: Low Reviewed Nov 07, 2026 Reviewed revision eb9932a671c9 New commits since this review; the score may not cover them
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/headroom.svg)](https://followagents.com/en/agents/headroom)
<a href="https://followagents.com/en/agents/headroom"><img src="https://followagents.com/badge/headroom.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v0.45.0 Release v0.45.0
    Release notes excerpt
    [0.45.0](https://github.com/headroomlabs-ai/headroom/compare/v0.44.0...v0.45.0) (2026-11-22) Features * opencode: add repeatable --extra-model flag for custom wrap-time models ([#2364](https://github.com/headroomlabs-ai/headroom/issues/2364)) ([66e0086](https://github.com/headroomlabs-ai/headroom/commit/66e0086952d4b311c9fe9b489fbd12d1d270fcde)) …
    View on GitHub ↗
  2. v0.44.0 Release v0.44.0
    Release notes excerpt
    [0.44.0](https://github.com/headroomlabs-ai/headroom/compare/v0.43.1...v0.44.0) (2026-11-09) ⚠ BREAKING CHANGES * packaging: keep PyTorch extras out of all ([#4067](https://github.com/headroomlabs-ai/headroom/issues/4067)) Features * pipeline: say whose request an OutcomeSnapshot is ([#4698](https://github.com/headroomlabs-ai/headroom/issues/4698)) ([a2bcbd1](https://github.com/headroomlabs-ai/headroom/commit/a2bcbd101b1391debfd218ec8c63cb72d2bc240a)) …
    View on GitHub ↗
  3. v0.43.1 Release v0.43.1
    Release notes excerpt
    [0.43.1](https://github.com/headroomlabs-ai/headroom/compare/v0.43.0...v0.43.1) (2026-11-05) Bug Fixes * ccr: keep the in-memory order queue from evicting re-stored entries ([#4545](https://github.com/headroomlabs-ai/headroom/issues/4545)) ([c6f5bf9](https://github.com/headroomlabs-ai/headroom/commit/c6f5bf9549e9b357e9c2369d4e04bc437f5e180d)) …
    View on GitHub ↗

FAQ

Can Headroom handle large JSON payloads?
Yes, SmartCrusher is designed to compress large JSON arrays and nested objects with typical savings of 60-95%.
Do I need to modify my code to use Headroom?
No, you can use headroom proxy as a zero-code drop-in proxy for any client that supports OpenAI-compatible APIs, or use headroom wrap to automatically configure specific agents.
Does Headroom support live context?
Yes, it can compress new tokens while preserving the cached prefix, avoiding provider KV cache busts.
How does output shaping affect reasoning?
It reduces thinking budget for routine steps like file reads, but retains full reasoning for new questions or errors, as described in the README.
Can I run Headroom as a shared service?
Yes, headroom proxy can be deployed as a shared, always-on service, with central config and dashboards, though the OSS version is optimized for individual developers.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts