Headroom

Active
GitHub Python Apache-2.0

Description

Context compression layer that compresses tool outputs, logs, files, and RAG chunks before they reach the LLM, saving 60-95% of tokens while preserving answer quality. Available as library, proxy, or MCP server.

Key Features

  • Compress everything before LLM receives it, reducing 60-95% of tokens
  • Three usage modes: library, proxy, and one-command agent wrapping
  • Built-in MCP server with cross-agent shared memory
  • ContentRouter auto-detects content type and selects optimal compressor
  • CCR reversible compression: originals never deleted, retrieved on demand
  • Compatible with Claude, Codex, Cursor, Aider, and Copilot agents
  • headroom learn mines failed sessions and writes corrections back to CLAUDE.md / AGENTS.md

Use Cases

💡 Reduce API costs for AI agent workloads
💡 Compress code search, SRE debugging, and issue triage outputs
💡 Cross-agent context sharing and memory reuse
💡 Efficient transmission of long conversation history and RAG results
💡 Enterprise LLM application token optimization

Quick Start

# Install and wrap your agent
pip install "headroom-ai[all]"
headroom wrap claude           # one-command wrap for Claude/Codex/Cursor
headroom proxy --port 8787     # or run as a proxy
headroom perf                  # inspect token savings

Related Projects