At a glance
| Tool | What it cuts | Price | License |
|---|---|---|---|
| Headroom | Tool output, logs and history before they reach the model | App: paid, 7-day free trial. CLI: free | Apache-2.0 engine |
| Caveman | Agent context (proxy) and reply length (skill) | Free | Apache-2.0 |
| context-mode | Large tool output, kept out of the window | Free plugin, paid hosted gateway | Elastic-2.0 (source-available) |
| Ponytail | The code the agent writes | Free | MIT |
| Serena | Whole-file reads | Free | GPL-3.0 |
| Codebase Memory | File-by-file exploration | Free | MIT |
| vexp | The code the agent reads | Free tier, Pro $19 a month | Proprietary |
| MarkItDown | PDFs and Office files | Free | MIT |
| Context7 | Retries caused by outdated library APIs | Free tier, Pro $10 a seat a month | MIT (MCP server) |
| claude-code-router | Model choice | Free | MIT |
| ccusage | Nothing: it measures | Free | MIT |
Compress what the agent sends
Most of a long session's input is not your prompt. It is test runs, build logs, search results and earlier turns, re-sent on every request. A local proxy compresses that before it leaves your machine. Pick one: two proxies on the same request fight over the same tokens.
1. Headroom: a finished app for Claude Code and ChatGPT Codex
Headroom is a menu bar app for macOS, Windows and Linux that routes Claude Code and ChatGPT Codex through a local proxy. It compresses tool output, logs and history by content type and keeps the originals retrievable, so the model can ask for anything it needs back. It sets itself up, updates itself and shows what it saved per session. It also installs most of the tools below as one-click add-ons. Across 183 Claude Code users in one week, it removed 34% of input tokens (our production data). The engine is the free, Apache-2.0 Headroom CLI; the app is paid after a 7-day trial with no credit card.
2. Caveman: an open-source toolkit for many agents
Caveman started as a skill that makes the agent reply in fewer words. Version 4 added a local proxy and engine, which makes it Headroom's closest open-source counterpart. It covers more agents (Gemini CLI and Aider among them) and more experimental features, and you assemble and update it yourself. It is free and Apache-2.0; install it with npx @caveman-ai/cli@latest. Maker's claim: 33.2% fewer input tokens, over 54 runs in August 2026. See the Headroom vs Caveman comparison for both sides.
3. context-mode: keep big tool output out of the window
context-mode works through hooks rather than a proxy. It runs large tool output in a local sandbox, indexes it, and hands the agent only the parts it asks for. It works with Claude Code, Codex, Gemini CLI, OpenCode and more. The plugin is free and source-available under the Elastic License 2.0, which is not an open-source license. Maker's claim: 99.4% of output bytes saved, counted on runs with more than 10 KB of output. It overlaps with a compressor on tool output, so measure before running both.
Write less code
4. Ponytail: the least code that works
Ponytail is a free skill that makes the agent ship the smallest change that solves the task. Output tokens cost five times as much as input on Claude's list prices, and less code is also less to re-read and edit later. It works in Claude Code, Codex and OpenCode. Maker's claim: 45% fewer tokens and 26% lower cost, across 39 tasks run 5 times each with and without it. Install it with /plugin marketplace add DietrichGebert/ponytail, then /plugin install ponytail@ponytail. The Ponytail guide covers the levels and commands.
Read less of the codebase
On a large repository the agent can spend most of its context finding the code it needs. These tools let it look things up instead of reading file after file.
5. Serena: read one symbol, not the whole file
Serena gives the agent language-server tools: find a function, its references, or one class, and read only that. It is free, GPL-3.0 since September 2026, and works with Claude Code, Codex, OpenCode and Cursor. Install it with uv tool install -p 3.13 serena-agent, then serena setup claude-code. Its maker publishes no savings figure.
6. Codebase Memory: a code graph the agent queries
Codebase Memory indexes your repository into a local graph once and answers the agent's questions from it through MCP tools. It is free, MIT-licensed, and detects Claude Code, Codex, OpenCode and Cursor on install. Maker's claim: 10x lower token use and 2.1x fewer tool calls than file-by-file exploration, from a 31-repository study.
7. vexp: a paid context engine
vexp builds a local index of your code and hands the agent a token-budgeted bundle of the parts that matter. It is proprietary, with a free tier capped at 20 calls a day and a Pro plan at $19 a month. Maker's claim: 65% fewer input tokens, on 7 tasks in one FastAPI codebase. It stacks with an input-side compressor; the Headroom vs vexp page explains how.
Read documents and docs efficiently
8. MarkItDown: documents as Markdown
MarkItDown, from Microsoft, converts PDF, Word, PowerPoint and Excel files to Markdown before the agent reads them, so it gets the text without the file format around it. It is free and MIT-licensed. Install it with pip install 'markitdown[all]'; markitdown-mcp exposes it to any MCP client.
9. Context7: current library docs
Context7 pulls version-specific library documentation into the session. It adds tokens rather than removing them. It earns them back when the agent would otherwise write code against an outdated API and spend several turns fixing it. The free tier gives 1,000 calls a month, then 20 a day; Pro is $10 a seat a month.
Route and measure
10. claude-code-router: pick the model per request
claude-code-router is a free local gateway that sends Claude Code's requests to the providers and models you choose, for example a cheaper model for background tasks. It changes which model you pay for rather than how many tokens you send. Install it with npm install -g @musistudio/claude-code-router.
11. ccusage: see where the tokens went
ccusage reads Claude Code's local logs and reports tokens and cost by day or by session. It saves nothing on its own, but it is how you check that the tools above did. Run npx ccusage@latest; it reads Codex and OpenCode logs too.
Built into Claude Code, and free
Claude Code's cost docs put the average at about $13 per developer per active day. These settings lower it before you install anything:
- Clear between tasks.
/clearcosts nothing and drops everything the next task does not need./compactkeeps a summary, but the summary is itself a large request, so tell it what to keep. - Look before you trim.
/contextshows what fills the window, with suggestions./usage(formerly/cost) shows what used your plan. - Use a smaller model where it is enough.
/modeland/effortset the main session. Give a subagentmodel: haiku, or setCLAUDE_CODE_SUBAGENT_MODELfor all of them. - Keep CLAUDE.md short. It loads on every session. The docs suggest under 200 lines, with workflow detail moved into skills that load only when used.
- Block files with deny rules. A
.claudeignorefile has no effect. To keep the agent out of build output, add a rule such as"permissions": { "deny": ["Read(./dist/**)"] }to your settings. - Filter tool output with hooks. A hook can trim a command's output before Claude sees it.
The guide to reducing Claude Code costs walks through each of these levers in order.
How to combine them
The tools in different sections stack, because they cut different tokens. A typical setup is one compressor, Ponytail, one code-lookup tool and ccusage. Two tools from the same section mostly overlap: two compressors fight over the same request, and Serena, Codebase Memory and vexp all answer the same question. Headroom installs Ponytail, Serena, Codebase Memory, MarkItDown, Context7 and Caveman's skill from its Add-ons screen, so you can try them without setting each one up.
How we checked
Prices, licenses, install commands and supported agents come from each project's own repository or site, checked on November 5, 2026. Savings figures are the makers' own and are measured on different tasks, so they do not compare with each other. The figure that counts is your own: run a task you already do with and without a tool, and compare in ccusage or Headroom's activity view.