What is the best open-source tool to cut Claude Code and coding agent token usage?
The best open-source AI repos for cutting coding agent token usage right now are Caveman, Headroom and Context Mode. Caveman is the quickest win (one skill makes the agent answer tersely and read less); Headroom and RTK compress tool, log and command output before it reaches the model; Context Mode keeps raw tool output out of the context window and saves session memory in SQLite.
Comparison
| Repo | What it does | Stars | Start here |
|---|---|---|---|
| Caveman | Caveman is a skill and proxy for coding agents that cuts tokens by making the agent talk tersely and read less, while code stays exact. | 114,855 | Cut your coding agent's token use with one skill |
| Headroom | Headroom is an open-source tool that compresses tool outputs, logs, files, RAG chunks and chat history on your machine before they reach an LLM, available as a Python or TypeScript library, a local proxy, and an MCP server. | 77,499 | Cut Claude Code token use with one wrap command |
| Context Mode | Context Mode is an MCP server and hook set for AI coding agents that keeps raw tool output out of the context window, persists session memory in SQLite, and routes work across many clients. | 31,762 | Keep large tool output out of Claude Code's context |
| RTK | RTK is a single Rust binary that filters and compresses the output of 100 plus common dev commands before it reaches an AI coding agent's context, with hooks for many agents and a savings dashboard. | n/a | Cut your coding agent's token use from command output |
| Repo Context MCP | repo-context-mcp is a local MCP server and CLI that gives AI coding agents a repository map, fast code search and token-budgeted context packs instead of dumping whole repos into prompts. | n/a | Give your coding agent a repo map and code search |
| Cache Tax | Cache Tax is a Claude Code mod that keeps the prompt cache warm during breaks and shows the estimated rewrite cost before a cold send. | 270 | Keep Claude Code's cache warm during a break |
When to pick which
Caveman
Caveman is a skill and proxy for coding agents that cuts tokens by making the agent talk tersely and read less, while code stays exact. The README reports 33.2% fewer input tokens across 54 Claude Code runs and links an Adobe Research paper on caveman-style output; it also links a page listing every case where caveman loses. It installs as a skill, a Claude Code plugin, a Gemini CLI extension or an all-agents installer, with an optional free Auto model router.
Best for: Developers who pay per token for Claude Code, Codex or Gemini CLI and want shorter answers and smaller context without losing correctness.
Needs: A coding agent such as Claude Code, Codex or Gemini CLI; Node.js for the npx installs (22.13+ for the all-agents installer)
Start here: Cut your coding agent's token use with one skill
- Install for every agent with npx skills add JuliusBrussee/caveman -g
- Or in Claude Code: /plugin marketplace add JuliusBrussee/caveman then /plugin install caveman@caveman
- Type /caveman ($caveman in Codex) if it does not start on its own; /ultracave is even shorter
- Say stop caveman to go back to normal
Headroom
Headroom is an open-source tool that compresses tool outputs, logs, files, RAG chunks and chat history on your machine before they reach an LLM, available as a Python or TypeScript library, a local proxy, and an MCP server.
Best for: Developers and platform teams who run coding agents or LLM apps and want fewer tokens sent and billed per request.
Needs: Python 3.13 with uv, or pip, to install the headroom-ai package; An account with an LLM provider such as Anthropic or OpenAI; A coding agent or app that sends prompts through an API
Start here: Cut Claude Code token use with one wrap command
- Install the CLI with uv tool install --python 3.13 "headroom-ai[all]"
- Run headroom doctor to confirm routing works
- Start a wrapped session with headroom wrap claude
- Work as usual, then check results with headroom savings
Context Mode
Context Mode is an MCP server and hook set for AI coding agents that keeps raw tool output out of the context window, persists session memory in SQLite, and routes work across many clients.
Best for: Developers who use AI coding agents on large codebases and notice their context window filling up during long sessions.
Needs: Claude Code v1.0.33+ for the plugin install, or Node.js >= 22.5 (or Bun) for the Gemini CLI setup; An existing AI coding agent session in a project you want to work on
Start here: Keep large tool output out of Claude Code's context
- Run /plugin marketplace add mksglu/context-mode in Claude Code.
- Run /plugin install context-mode@context-mode.
- Restart Claude Code or run /reload-plugins.
- Run /context-mode:ctx-doctor and confirm all checks show [x].
RTK
RTK is a single Rust binary that filters and compresses the output of 100 plus common dev commands before it reaches an AI coding agent's context, with hooks for many agents and a savings dashboard.
Best for: Developers using coding agents who want to cut token usage from noisy command output.
Needs: macOS, Linux or Windows; A supported coding agent
Start here: Cut your coding agent's token use from command output
- Install: brew install rtk on macOS or Linux, winget install rtk-ai.rtk on Windows, or the install.sh script
- Check it: rtk --version, then rtk gain must show the savings dashboard, not command not found
- Hook it into Claude Code (or Copilot) with rtk init -g, then restart the tool
- Test with git status in the agent; it is rewritten to RTK git status
Repo Context MCP
repo-context-mcp is a local MCP server and CLI that gives AI coding agents a repository map, fast code search and token-budgeted context packs instead of dumping whole repos into prompts.
Best for: Developers using Codex, Claude Code, Cursor or Cline on large repositories or monorepos.
Needs: Node.js 18+
Start here: Give your coding agent a repo map and code search
- Install Node.js 18+
- Add a server with command npx, args -y Repo Context MCP, and REPO_CONTEXT_ROOT set to your repo
- Restart your MCP client
- Ask the agent to call repo_map before editing
Cache Tax
Cache Tax is a Claude Code mod that keeps the prompt cache warm during breaks and shows the estimated rewrite cost before a cold send.
Best for: Developers who use Claude Code in long sessions and want to avoid paying to rewrite a large cached context after a break.
Needs: Claude Code 2.1.287 or later; A one-hour cache (included subscription usage defaults to one hour; API-key, usage-credit and cloud-provider sessions default to five minutes and need promptCacheTtl set to "1h"); Claude Code left running during the break
Start here: Keep Claude Code's cache warm during a break
- Run claude plugin marketplace add karanb192/claude-code-mods in a terminal.
- Run claude plugin install cache-tax@claude-code-mods, then restart Claude Code or run /reload-plugins in an open session.
- If you use API-key, usage-credit or cloud-provider billing, set promptCacheTtl to "1h" so the main cache lasts an hour.
- In a warm session, run /keepwarm 90m before your break, or /keepwarm for the six-hour default.
Use cases for cutting coding agent token usage
- Cut your coding agent's token use with one skill
- Shrink what your agent reads: logs, test output and web pages
- Add Caveman to Gemini CLI as an extension
- Cut Claude Code token use with one wrap command
- Shrink messages in a Python app before each LLM call
- Route any OpenAI-compatible client through a local proxy
- Keep large tool output out of Claude Code's context
- Count or summarize code with one script, not many reads
- Pick up a coding task after the chat compacts
- Cut your coding agent's token use from command output
- Set up RTK for Codex, Gemini CLI, Cursor and other agents
- Use the Apache-only RTK edition for license-sensitive teams
- Give your coding agent a repo map and code search
- Build a token-budgeted context pack for a prompt
- Generate repo maps as JSON for CI and scripts
- Keep Claude Code's cache warm during a break
- See the rewrite price before a cold send
- Keep every session warm with always mode
Questions
What is the best open-source tool to cut Claude Code and coding agent token usage?
The best open-source AI repos for cutting coding agent token usage right now are Caveman, Headroom and Context Mode. Caveman is the quickest win (one skill makes the agent answer tersely and read less); Headroom and RTK compress tool, log and command output before it reaches the model; Context Mode keeps raw tool output out of the context window and saves session memory in SQLite.
Which repo for cutting coding agent token usage is easiest to start with?
Caveman: its starter use case "Cut your coding agent's token use with one skill" is rated Beginner and takes about 5 minutes.
How do I get started with Caveman?
Install for every agent with npx skills add JuliusBrussee/caveman -g; Or in Claude Code: /plugin marketplace add JuliusBrussee/caveman then /plugin install caveman@caveman; Type /caveman ($caveman in Codex) if it does not start on its own; /ultracave is even shorter. Full steps and a copy-paste agent prompt: https://dedupedai.com/use-cases/juliusbrussee-caveman/cut-coding-agent-tokens-with-the-caveman-skill/
Are these cutting coding agent token usage repos free?
They are open-source projects on GitHub (check each license; some, like fair-code projects, limit commercial use). Some also sell a hosted version or need a paid model API key; the requirements for each repo are listed on this page.
How is this list of cutting coding agent token usage repos chosen?
Deduped tracks the hottest AI repos on GitHub and writes step-by-step use cases from each README. For this page we picked the repos that do this job, ordered by fit and then GitHub stars. Repos with a risk flag or a retired page are left out. The page is rebuilt with the site; stars are as of the last build in 2026.
More answers
- Best open-source AI repos for running LLMs locally
- Best open-source AI repos for AI coding agents
- Best open-source AI repos for skills and workflows for coding agents
- Best open-source AI repos for browser automation with AI agents
- Best open-source AI repos for web scraping for LLMs and RAG
- Best open-source AI repos for RAG and chatting with your documents
- Best open-source AI repos for long-term memory for AI agents
- Best open-source AI repos for voice, speech-to-text and text-to-speech
- Best open-source AI repos for AI video editing and generation
- Best open-source AI repos for AI image generation and editing
- Best open-source AI repos for UI design with AI coding agents
- Best open-source AI repos for MCP servers
- Best open-source AI repos for 3D modeling and CAD with AI
- Best open-source AI repos for research with AI agents
- Best open-source AI repos for running several coding agents in parallel
- Best open-source AI repos for LLM gateways and model routers
- Best open-source AI repos for AI workflow automation
- Best open-source AI repos for self-hosted personal AI assistants
- Best open-source AI repos for sandboxing AI agents
- Best open-source AI repos for securing AI coding agents
- Best open-source AI repos for AI code review
- Best open-source AI repos for drawing diagrams with AI
- Best open-source AI repos for SEO and AI search visibility (GEO)
- Best open-source AI repos for game development with AI agents
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them free