Every time an AI coding agent like Claude Code, Cursor or GitHub Copilot runs a command, it has to read the result: a file's full contents, a wall of terminal output, a browser screenshot dumped as text. All of that eats into a limited budget called "context." Fill it up with noise and the agent gets slower, costs more per request, and starts forgetting decisions you made ten minutes earlier in the same session. Two new tools attack that problem from opposite ends: Context Mode gives the agent a persistent memory it can search instead of re-reading everything, while Headroom compresses the raw output before it ever reaches the model. They're not really competitors so much as two different bets on where the waste actually is.
The short version
| Context Mode | Headroom | |
|---|---|---|
| Built for | Persistent session memory + sandboxed tool output | Compressing tool output, logs and JSON before the LLM sees them |
| License | Elastic License v2 (source-available, not open source) | Apache 2.0 (fully open source, no restrictions) |
| Reported savings | ~98% reduction on verbose tool output (e.g. Playwright snapshots) | 60-95% on JSON; only 15-20% on plain code |
| Cross-session memory | Yes — SQLite storage with FTS5/BM25 search | No — compresses each call, doesn't remember past sessions |
| Platform support | ~17 platforms (Claude Code, Cursor, VS Code, Gemini CLI...) | 100+ LLM providers via LiteLLM |
| Setup effort | Plug-and-play MCP server | Needs configuration (library, proxy or MCP mode) for real gains |
| Known gaps | Incomplete hook support on Cursor/Zed/Antigravity; Linux+Node<22.5 unsupported | TypeScript SDK still library-only; young project |
Context Mode — sandboxed output plus memory that survives between sessions
Context Mode is an MCP server that sandboxes what your agent's tools spit out and gives it a searchable memory that persists across sessions, instead of forcing it to re-read everything from scratch each time. It claims roughly 98% reduction on the worst offenders, like full-page browser snapshots, backed by SQLite storage with FTS5/BM25 full-text search. It works across around 17 different coding environments, from Claude Code and Cursor to VS Code and Gemini CLI, and ships with six sandbox tools plus built-in diagnostics.
Who it's for: developers and teams running AI coding agents daily who want the agent to actually remember what happened in earlier sessions, not just receive less noise per call.
Pricing: free on GitHub, npm and major marketplaces — but under the Elastic License v2, which is source-available rather than open source and can restrict commercial production use.
Honest limits: the licensing model is worth reading closely if you plan to build on it commercially; Cursor lacks the SessionStart hook so memory restoration after context compaction is incomplete; Zed and Antigravity have no hook support at all, requiring manual workarounds; and it doesn't run on Linux with Node under 22.5 due to native binary issues.
Headroom — compress everything before it reaches the model
Headroom takes a narrower, more universal approach: it's an open-source library that compresses tool outputs, logs and JSON before they hit the LLM, cutting token costs by a measured 60-95% without changing the answers you get back. The compression is reversible — nothing is permanently lost, it can be recovered on demand — and it runs local-first, so the data being compressed never leaves your machine. It plugs into over 100 LLM providers through LiteLLM and integrates with Claude Code, Cursor and Copilot.
Who it's for: teams running AI coding agents at volume who mainly want to cut their token bill, without switching providers or needing the agent to remember past sessions.
Pricing: completely free under Apache 2.0, with no paid tier and no vendor lock-in.
Honest limits: the gains are lopsided by content type — 95% on JSON but only 15-20% on plain code — and getting the bigger numbers requires actually configuring the proxy mode, not just installing it. The TypeScript SDK is still limited to library mode (no proxy yet), and as a young project, some provider-specific nuances, like how it interacts with Anthropic's own prompt caching, still take a bit of learning.
Pick Context Mode if…
…you want your agent to genuinely remember files, decisions and past conversations across multiple sessions, not just receive less noise on any single call — and you're comfortable with a source-available license instead of a fully open one.
Pick Headroom if…
…your main problem is the token bill itself, you want a permissively licensed tool with zero lock-in, and you don't need the agent to recall anything from before the current session.
The two aren't mutually exclusive: nothing stops a team from running Headroom to shrink what gets sent on every call while also giving the agent Context Mode's persistent memory for the things worth remembering across sessions. Which one to start with just depends on whether the pain is the bill or the amnesia.