Headroom

A local context compression tool that reduces LLM inputs, caches originals for retrieval, and connects to coding agents and OpenAI-compatible clients.

Screenshot of Headroom website

Headroom reduces the context that LLM apps and coding agents send to a model. It's for developers whose prompts fill up with repetitive tool results, logs, file contents and retrieved documents. Compression runs locally, but model requests still go to the chosen LLM provider.

  • Content compression: Shorten JSON, logs, search results, prose, Git diffs and images while retaining details such as errors and unusual values; optional source-code compression preserves signatures and collapses function bodies.
  • Original retrieval: Keep full originals in a local cache and give the model a retrieval tool for details omitted from compressed context.
  • Agent and app connections: Use a proxy, Python or TypeScript library, or MCP server with Claude Code, Codex, Cursor and OpenAI-compatible clients, plus integrations such as LangChain and Vercel AI SDK.
  • Memory and caching: Preserve stable prompt prefixes for provider caching, retain memory across conversations and compress context shared between agents.
  • Output reduction: The proxy can encourage shorter responses and reduce reasoning effort on routine follow-up turns while retaining full effort for new questions and errors.

Headroom is open source under Apache 2.0. It doesn't send prompt or file contents to an external compression service. Provider connections include OpenAI, Anthropic, Google and Bedrock, with additional compatibility through LiteLLM. Savings depend on the material: repeated records and verbose logs offer more room for reduction than dense prose. Source-code compression is disabled by default.

Similar to Headroom