On this page
Start with Claude Code's own controls (/clear, /compact, a short CLAUDE.md, a cheaper model, subagents), measure with ccusage, then add one tool for the specific waste you see: RTK or repowise distill for noisy command output, Serena for symbol-level navigation, repowise MCP for precomputed repository context, Context7 for library docs. On large repositories the biggest waste is usually exploration: reading files to find the right one.
| Tool | Reduces | Mechanism | Cost |
|---|---|---|---|
| Claude Code built-ins | Stale and bloated context | /clear, /compact, model choice, subagents, skills | Included |
| ccusage | Nothing directly; measures | Reads local usage data, reports by day, session, model | Free, MIT |
| RTK | Shell output | CLI proxy that filters command output | Free; mixed licenses |
| Serena | File reads | Symbol-level retrieval and editing over MCP | Free; GPL-3.0 |
| Context7 | Outdated-docs retries | Version-specific library docs over MCP | Free server code, MIT |
| repowise distill | Shell output | repowise distill <cmd> shrinks command output | Free OSS, AGPL-3.0 |
| repowise MCP | Exploration reads | Precomputed repository answers over MCP | Free OSS, AGPL-3.0 |
Scroll the table sideways to see every column.
Facts are from each project's repository and from Anthropic's cost documentation, read on 1 November 2026.
We build repowise, so weigh our entry accordingly. The measurements we publish about it, with their methods, are on the benchmarks page.
How we evaluated
- Where it saves: input context, tool output, or exploration reads.
- What evidence exists: vendor claims, independent reruns, or none.
- What it costs you: setup, another process, a license to read.
- Fit for large repos: whether it helps when the codebase does not fit in context.
Claude Code's built-in controls
Anthropic's own guidance is that token cost scales with context size, so keep context small. The cost docs list the habits: use /clear between unrelated tasks, give /compact instructions about what to keep, keep CLAUDE.md under 200 lines and move workflow detail into skills that load on demand, match the model to the job, lower the effort level for simple tasks, and delegate verbose operations such as test runs to subagents so only a summary returns.
Prompt caching already reduces cost on repeated content, and /usage shows the cache hit share and what counts against plan limits. Two traps from the same page: compacting a large context is itself a large request, and the first message after a long idle break misses the cache.
Pick these first. They cost nothing and apply to every repository.
ccusage: measure first
ccusage tells you where the tokens went. It reads local usage data from Claude Code and a dozen other agent CLIs and reports daily, weekly, monthly and per-session usage and cost, with separate cache token counts and per-model breakdowns. Run npx ccusage@latest (GitHub, MIT).
Pick it if you are about to install tools to save tokens. A baseline turns a hunch into a before and after.
RTK and repowise distill: shrink command output
Shell output is a common source of wasted tokens: a full npm ci log or git log rarely helps the agent. RTK is a Rust CLI proxy that filters and compresses command output for agents including Claude Code, covering 100+ commands; its README claims 60 to 90% savings on common dev commands and says that applies to bash output only, not the full bill (GitHub). JetBrains reran that claim on real agent work with Sonnet 5 in July 2026 and measured 7.6% more expensive, per their write-up. Treat RTK's advertised percentage as a ceiling for one command.
repowise distill <cmd> does the same job inside repowise: it shrinks noisy output and repowise expand restores what was cut. On single commands in repowise's published benchmarks it saved 89% on git log -50 and 61% on a pytest run with 11 failures, with every FAILED line kept.
Pick either if your sessions are dominated by test, build and log output. Pick distill if you already run repowise, since it ships with the same install and Claude Code and Codex hooks can rewrite commands through it.
Serena: symbol-level navigation
Serena gives the agent IDE-style symbol tools so it reads functions instead of whole files. It is an MCP toolkit for semantic retrieval, editing and refactoring, built on language servers with support for over 40 languages (per its README). The application is GPL-3.0-or-later; its SolidLSP component is MIT.
Pick it if you want precise navigation and editing in a language its servers handle well. It works on the live checkout, so it does not carry history or ownership.
Context7: current library docs
Context7 saves tokens in one case: the agent writes code against an outdated library API, then retries. It is an MCP server that returns version-specific documentation through two tools, resolve-library-id and query-docs (MIT; the backend is private, per its README). It does nothing for your own repository.
Pick it if wrong or deprecated third-party API calls are your main source of rework.
repowise MCP: precomputed repository context
repowise indexes the repository once, so the agent asks instead of exploring. The index holds the dependency graph, health, ownership, git history and decisions. The ten repowise MCP tools include get_answer for one cited answer to a how or where question, get_context for a triage card per file or symbol, and get_symbol for verified line-numbered source of one symbol. A lean profile keeps the tool list shorter, which keeps tool definitions small.
On a pre-registered run against a bare agent on Django, repowise cut output tokens by 15.9% on Claude Code with Sonnet, with conditions on the benchmarks page. The saving was larger on harder questions. Install through the Claude Code plugin:
/plugin marketplace add repowise-dev/repowise
/plugin install repowise@repowise
Or run repowise init --yes --no-prose in the repository, which needs no API key. The Claude Code page shows the full setup, and how Claude Code handles large codebases explains the exploration problem it targets.
Pick repowise if your repository is large, you run several agents, or you want ownership and risk in the same answer. Claude Code gets the full plugin; Cursor, Copilot and others get MCP plus instructions.
How to choose
- Any repository: the built-in habits, then ccusage to see the result.
- Noisy shell output: RTK or repowise distill, and verify the saving on your tasks.
- Typed language, precise edits: Serena.
- Library API mistakes: Context7.
- Large or unfamiliar repo, many questions: repowise MCP.
- Enterprise teams: use the Claude Code analytics and OpenTelemetry export the cost docs describe to see spend per developer, and run repowise self-hosted.
FAQ
- How do I reduce Claude Code token usage?
- Clear context between tasks, compact with instructions, keep CLAUDE.md short, use a cheaper model for simple work, lower the effort level and delegate verbose operations to subagents. These are the habits in Anthropic's cost documentation.
- Does /compact save tokens?
- It shrinks the conversation going forward, but it reads the whole conversation to summarize it, so compacting a large context is a large request itself.
/clearbetween unrelated tasks costs nothing. - Are tools like RTK worth it?
- They cut shell output, which is only part of an agent's input. JetBrains' July 2026 rerun of RTK's advertised savings found a much smaller effect than the headline, so measure on your own work before standardizing.
- How do I see how many tokens Claude Code uses?
- Run
/usagein a session, ornpx ccusage@latestfor daily, weekly and per-session reports from local data. - Does an MCP server increase token usage?
- Tool definitions can add context, but Claude Code defers MCP tool definitions by default, so only tool names and server instructions enter context until a tool is used. Disable servers you do not use.
- Which tool reduces tokens on a large codebase?
- Exploration is the main cost there, so symbol tools (Serena) and precomputed context (repowise MCP) target it directly. Built-in habits and command-output filters help alongside them.