{
 "schema_version": 1,
 "generated": "2026-10-29",
 "url": "https://dedupedai.com/best-ai-repos-for/cutting-coding-agent-token-usage/",
 "task": "cutting coding agent token usage",
 "question": "What is the best open-source tool to cut Claude Code and coding agent token usage?",
 "answer": "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.",
 "md": "https://dedupedai.com/best-ai-repos-for/cutting-coding-agent-token-usage/index.md",
 "repos": [
  {
   "repo": "JuliusBrussee/caveman",
   "title": "Caveman",
   "url": "https://dedupedai.com/use-cases/juliusbrussee-caveman/",
   "github": "https://github.com/JuliusBrussee/caveman",
   "what": "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.",
   "who": "Developers who pay per token for Claude Code, Codex or Gemini CLI and want shorter answers and smaller context without losing correctness.",
   "stars": 114855,
   "language": "Go",
   "requirements": [
    "A coding agent such as Claude Code, Codex or Gemini CLI",
    "Node.js for the npx installs (22.13+ for the all-agents installer)"
   ],
   "uc_count": 3,
   "use_cases": [
    {
     "title": "Cut your coding agent's token use with one skill",
     "url": "https://dedupedai.com/use-cases/juliusbrussee-caveman/cut-coding-agent-tokens-with-the-caveman-skill/"
    },
    {
     "title": "Shrink what your agent reads: logs, test output and web pages",
     "url": "https://dedupedai.com/use-cases/juliusbrussee-caveman/shrink-the-context-your-agent-reads/"
    },
    {
     "title": "Add Caveman to Gemini CLI as an extension",
     "url": "https://dedupedai.com/use-cases/juliusbrussee-caveman/install-caveman-in-gemini-cli/"
    }
   ],
   "best": {
    "title": "Cut your coding agent's token use with one skill",
    "url": "https://dedupedai.com/use-cases/juliusbrussee-caveman/cut-coding-agent-tokens-with-the-caveman-skill/",
    "difficulty": "Beginner",
    "time": "5 minutes",
    "agents": [
     "claude-code",
     "codex",
     "gemini-cli"
    ],
    "steps": [
     "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"
    ],
    "md": "https://dedupedai.com/use-cases/juliusbrussee-caveman/cut-coding-agent-tokens-with-the-caveman-skill/index.md"
   }
  },
  {
   "repo": "headroomlabs-ai/headroom",
   "title": "Headroom",
   "url": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/",
   "github": "https://github.com/headroomlabs-ai/headroom",
   "what": "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.",
   "who": "Developers and platform teams who run coding agents or LLM apps and want fewer tokens sent and billed per request.",
   "stars": 77499,
   "language": "Python",
   "requirements": [
    "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"
   ],
   "uc_count": 4,
   "use_cases": [
    {
     "title": "Cut Claude Code token use with one wrap command",
     "url": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/cut-token-spend-in-claude-code/"
    },
    {
     "title": "Shrink messages in a Python app before each LLM call",
     "url": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/compress-llm-calls-in-python-app/"
    },
    {
     "title": "Route any OpenAI-compatible client through a local proxy",
     "url": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/route-any-openai-client-through-proxy/"
    }
   ],
   "best": {
    "title": "Cut Claude Code token use with one wrap command",
    "url": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/cut-token-spend-in-claude-code/",
    "difficulty": "Intermediate",
    "time": "30 minutes",
    "agents": [
     "claude-code"
    ],
    "steps": [
     "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",
     "Remove the wrapping later with headroom unwrap claude"
    ],
    "md": "https://dedupedai.com/use-cases/headroomlabs-ai-headroom/cut-token-spend-in-claude-code/index.md"
   }
  },
  {
   "repo": "mksglu/context-mode",
   "title": "Context Mode",
   "url": "https://dedupedai.com/use-cases/mksglu-context-mode/",
   "github": "https://github.com/mksglu/context-mode",
   "what": "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.",
   "who": "Developers who use AI coding agents on large codebases and notice their context window filling up during long sessions.",
   "stars": 31762,
   "language": "TypeScript",
   "requirements": [
    "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"
   ],
   "uc_count": 5,
   "use_cases": [
    {
     "title": "Keep large tool output out of Claude Code's context",
     "url": "https://dedupedai.com/use-cases/mksglu-context-mode/cut-claude-code-context-bloat/"
    },
    {
     "title": "Count or summarize code with one script, not many reads",
     "url": "https://dedupedai.com/use-cases/mksglu-context-mode/run-analysis-as-a-script/"
    },
    {
     "title": "Pick up a coding task after the chat compacts",
     "url": "https://dedupedai.com/use-cases/mksglu-context-mode/resume-after-context-compaction/"
    }
   ],
   "best": {
    "title": "Keep large tool output out of Claude Code's context",
    "url": "https://dedupedai.com/use-cases/mksglu-context-mode/cut-claude-code-context-bloat/",
    "difficulty": "Beginner",
    "time": "15 minutes",
    "agents": [
     "claude-code"
    ],
    "steps": [
     "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].",
     "Work as usual, then run /context-mode:ctx-stats to see context savings by tool."
    ],
    "md": "https://dedupedai.com/use-cases/mksglu-context-mode/cut-claude-code-context-bloat/index.md"
   }
  },
  {
   "repo": "rtk-ai/rtk",
   "title": "RTK",
   "url": "https://dedupedai.com/use-cases/rtk-ai-rtk/",
   "github": "https://github.com/rtk-ai/rtk",
   "what": "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.",
   "who": "Developers using coding agents who want to cut token usage from noisy command output.",
   "stars": null,
   "language": "Rust",
   "requirements": [
    "macOS, Linux or Windows",
    "A supported coding agent"
   ],
   "uc_count": 3,
   "use_cases": [
    {
     "title": "Cut your coding agent's token use from command output",
     "url": "https://dedupedai.com/use-cases/rtk-ai-rtk/cut-agent-token-use-from-command-output/"
    },
    {
     "title": "Set up RTK for Codex, Gemini CLI, Cursor and other agents",
     "url": "https://dedupedai.com/use-cases/rtk-ai-rtk/set-up-rtk-for-codex-gemini-cursor/"
    },
    {
     "title": "Use the Apache-only RTK edition for license-sensitive teams",
     "url": "https://dedupedai.com/use-cases/rtk-ai-rtk/choose-apache-only-rtk-edition/"
    }
   ],
   "best": {
    "title": "Cut your coding agent's token use from command output",
    "url": "https://dedupedai.com/use-cases/rtk-ai-rtk/cut-agent-token-use-from-command-output/",
    "difficulty": "Beginner",
    "time": "10 minutes",
    "agents": [
     "claude-code"
    ],
    "steps": [
     "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",
     "The hook only fires on Bash tool calls, so ask the agent to use cat, rg or find, or RTK read, RTK grep and RTK find directly",
     "After a few sessions run rtk gain --graph and rtk discover to find missed savings"
    ],
    "md": "https://dedupedai.com/use-cases/rtk-ai-rtk/cut-agent-token-use-from-command-output/index.md"
   }
  },
  {
   "repo": "nduc99911/repo-context-mcp",
   "title": "Repo Context MCP",
   "url": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/",
   "github": "https://github.com/nduc99911/repo-context-mcp",
   "what": "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.",
   "who": "Developers using Codex, Claude Code, Cursor or Cline on large repositories or monorepos.",
   "stars": null,
   "language": "TypeScript",
   "requirements": [
    "Node.js 18+"
   ],
   "uc_count": 3,
   "use_cases": [
    {
     "title": "Give your coding agent a repo map and code search",
     "url": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/give-agent-repo-map-and-search/"
    },
    {
     "title": "Build a token-budgeted context pack for a prompt",
     "url": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/build-token-budgeted-context-pack/"
    },
    {
     "title": "Generate repo maps as JSON for CI and scripts",
     "url": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/repo-map-json-for-ci/"
    }
   ],
   "best": {
    "title": "Give your coding agent a repo map and code search",
    "url": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/give-agent-repo-map-and-search/",
    "difficulty": "Intermediate",
    "time": "15 minutes",
    "agents": [
     "codex",
     "claude-code",
     "cursor"
    ],
    "steps": [
     "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"
    ],
    "md": "https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/give-agent-repo-map-and-search/index.md"
   }
  },
  {
   "repo": "karanb192/cache-tax",
   "title": "Cache Tax",
   "url": "https://dedupedai.com/use-cases/karanb192-cache-tax/",
   "github": "https://github.com/karanb192/cache-tax",
   "what": "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.",
   "who": "Developers who use Claude Code in long sessions and want to avoid paying to rewrite a large cached context after a break.",
   "stars": 270,
   "language": "TypeScript",
   "requirements": [
    "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"
   ],
   "uc_count": 3,
   "use_cases": [
    {
     "title": "Keep Claude Code's cache warm during a break",
     "url": "https://dedupedai.com/use-cases/karanb192-cache-tax/keep-claude-code-cache-warm-on-break/"
    },
    {
     "title": "See the rewrite price before a cold send",
     "url": "https://dedupedai.com/use-cases/karanb192-cache-tax/check-cold-resend-price-before-sending/"
    },
    {
     "title": "Keep every session warm with always mode",
     "url": "https://dedupedai.com/use-cases/karanb192-cache-tax/keep-every-session-warm-across-breaks/"
    }
   ],
   "best": {
    "title": "Keep Claude Code's cache warm during a break",
    "url": "https://dedupedai.com/use-cases/karanb192-cache-tax/keep-claude-code-cache-warm-on-break/",
    "difficulty": "Intermediate",
    "time": "15 minutes",
    "agents": [
     "claude-code"
    ],
    "steps": [
     "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.",
     "On return, run /keepwarm status to see the warming window, next ping and last receipt."
    ],
    "md": "https://dedupedai.com/use-cases/karanb192-cache-tax/keep-claude-code-cache-warm-on-break/index.md"
   }
  }
 ]
}
