# Headroom

Headroom compresses tool outputs, logs, RAG chunks and files locally before they reach an LLM, reducing tokens for coding agents and cutting JSON payloads by 60 to 95 percent while keeping the same answers.

It runs as a Python or TypeScript library function, as a proxy that needs no code changes, as a one-command wrapper around agents such as Claude Code, Codex, Cursor and several others, or as an MCP server exposing compression, retrieval and stats tools to any MCP client. A cross-agent memory store shares deduplicated context across Claude, Codex, Gemini and Grok, and a learning mode mines failed sessions to write corrections into a project's CLAUDE.md or AGENTS.md file.

Internally, a content router picks a specialized compressor for JSON, source code or prose, a cache-aligner flags content that would break a provider's prompt cache without rewriting it, and originals are cached locally so an agent can retrieve the full text on demand. All compression happens on the user's own machine, so nothing is sent elsewhere to be compressed.

Python and TypeScript.

Website: https://docs.headroomlabs.ai/docs
