# Tools that reduce Claude Code token usage, compared

> Source: https://minniai.com/learn/tools-to-reduce-claude-code-token-usage (canonical HTML page)

[Guides](https://minniai.com/learn)


Tools that save tokens in Claude Code and Codex cut different things. Output filters such as RTK shorten what commands print. Code indexers such as codebase-memory-mcp save the agent from reading whole files. MinniMemoryMCP shrinks the memory files that load on every turn. ccusage cuts nothing, but shows where the tokens go. Measure first, find your biggest part, and pick the tool that acts on it.

Updated 2026-11-25

## What there is to cut

A coding agent sends the whole session again on every turn. Four parts of it grow, and a tool usually acts on one or two of them:

- **Memory and instructions:** `CLAUDE.md`, `AGENTS.md`, auto memory and every file they import, loaded from the first turn.
- **Command output:** test runs, builds, logs and diffs the agent reads once and then carries.
- **Code reading:** whole files opened to find one function.
- **Tool listings:** MCP servers and hooks that add text whether the task needs it or not.

Because these are different parts, tools for different parts can run together, and a saving on one part is not the same saving on the bill. [RTK’s own README](https://github.com/rtk-ai/rtk) makes the same point about command output and cost.

## Side by side

|  | What it cuts | How it plugs in | Agents it names | Licence |
| --- | --- | --- | --- | --- |
| MinniMemoryMCP | Memory files: a small part loads every turn, the rest when a task needs it | MCP server and a prompt hook; a Claude Code plugin | Claude Code and Codex | Apache-2.0 |
| RTK | Command output, before the agent reads it | A hook that rewrites shell commands, a CLI, and an optional proxy | Claude Code, Codex, Cursor, Gemini CLI, OpenCode and others | Apache-2.0, with parts under BUSL-1.1 |
| Headroom | "Compress tool outputs, logs, files, and RAG chunks before they reach the LLM" | A proxy, an agent launcher, an MCP server and a library | Claude Code, Codex, Cursor, Aider, Cline, Goose and others | Apache-2.0 |
| Token Optimizer MCP | Tool output and repeated reads of unchanged files | A plugin with hooks, an MCP server and a proxy | Claude Code, Codex, Copilot, Gemini and others | MIT |
| Token Savior | Code reading through a symbol index, and Bash output; it keeps its own memory store too | MCP server and hooks | Claude Code, Cursor, Gemini, Codex and OpenClaw | MIT |
| codebase-memory-mcp | Code reading and search: it answers from a graph of the repository | MCP server, a CLI and an installer | Claude Code, Codex, Cursor, Gemini CLI, Aider and others | MIT |
| ccusage | Nothing: it reports token usage and cost from local data | A CLI | Claude Code, Codex, OpenCode and others | MIT |

Sources, all read on 25 November 2026: [RTK](https://github.com/rtk-ai/rtk), [Headroom](https://github.com/headroomlabs-ai/headroom), [Token Optimizer MCP](https://github.com/ooples/token-optimizer-mcp), [Token Savior](https://github.com/Mibayy/token-savior), [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) and [ccusage](https://github.com/ryoppippi/ccusage). We left out every tool’s own percentage. Each one is measured on a different part, with a different method, so side by side they would mislead you.

## Measure before you install anything

- Run `/context` in Claude Code. It shows what fills the context window: memory files, MCP tools, messages.
- Run `/usage` after a normal session, or read your history with ccusage, for tokens and estimated cost.
- Find the biggest part you did not ask for. That is the one to cut.
- Change one thing, run the same kind of task again, and compare.

| If the biggest part is | Start with |
| --- | --- |
| Memory files | MinniMemoryMCP, or trim them by hand: CLAUDE.md too long |
| Command output | An output filter such as RTK, or a subagent for noisy commands |
| Files read whole | A code index, or more specific prompts |
| MCP tools | Nothing to install: turn off the servers you are not using with `/mcp` |
| The conversation itself | Nothing to install: `/clear` between tasks |

The last two rows are free. [Anthropic’s cost page](https://code.claude.com/docs/en/costs) lists more of them, including keeping `CLAUDE.md` under 200 lines, and [How to reduce Claude Code token usage](https://minniai.com/learn/reduce-claude-code-token-usage) goes through eight.

## Where MinniMemoryMCP fits

Memory is the part that is paid for on every turn of every session, and it grows each time you tell the agent to remember something. [MinniMemoryMCP](https://minniai.com/minnimemorymcp) reads the memory files your agent already loads, keeps the rules every task needs, and moves the rest into files opened only when a task matches. Every line is kept, the originals are backed up, and one command undoes it. It has no model inside it and makes no network call.

install it for Claude Code

```
$ npm i -g minnimemory
$ minnimemory install
```

We asked the same 30 questions in Claude Code 2.1.325 on Claude Sonnet 5.5, three full sessions a side: once with a test memory in the layout Claude Code itself writes, as it was, and once after MinniMemoryMCP 1.6.0 sorted it, with its server and hook on. Measured 15 November 2026: at API rates, a Claude Code session on our test memory cost $0.47 before MinniMemoryMCP 1.6.0 and $0.29 after on average, 37.7% less (each of the three sessions 33.9% to 40.0% less). A blind judge found 80 of 87 answers correct before and 81 after.

With MinniMemoryMCP 1.6.0 on our test memory, the agent went looking in its memory 17 times instead of 89 over the same 87 answers, and the run used 47.2% fewer tokens.

It does nothing about long test output or large files, so it runs well beside a tool that does. If your memory file is short, you do not need it yet.

## Questions to ask any of them

- **What does the figure count?** Tokens in one part, tokens in a session, or cost.
- **Were the answers checked?** Fewer tokens with a worse answer is not a saving.
- **Does it add tokens of its own?** An MCP server brings tool descriptions with it.
- **What leaves your computer?** Read its telemetry section.
- **Can you undo it?** Look for an uninstall that restores your files.

How we answer the first two is on the [evidence page](https://minniai.com/evidence). If you would rather spend nothing per token, see [Open-LLM coding agents compared](https://minniai.com/learn/open-llm-coding-agents). For Codex, see [How to reduce Codex token usage](https://minniai.com/learn/reduce-codex-token-usage).

Try MinniMemoryMCP

Free, runs on your computer, and every change can be undone. Two commands install it for Claude Code; the [docs](https://minniai.com/minnimemorymcp/docs) cover Codex and the rest.

install it for Claude Code

```
$ npm i -g minnimemory
$ minnimemory install
```

## More guides

- [How to reduce Claude Code token usage](https://minniai.com/learn/reduce-claude-code-token-usage) Where the tokens go each turn, and eight ways to spend fewer.

Updated 2026-11-25 · Minni Labs

- [Low-token coding agents: what makes one cheap to run](https://minniai.com/learn/low-token-coding-agent) Where a coding agent’s tokens go each turn, and the design choices that keep them down.

Updated 2026-11-27 · Minni Labs

- [Token optimization for AI agents: memory, body and brain](https://minniai.com/learn/token-optimization-for-ai-agents) Why agents burn tokens, and the three layers where you can cut them without a worse answer.

Updated 2026-11-27 · Minni Labs

- [An MCP server to reduce token usage in Claude Code and Codex](https://minniai.com/learn/mcp-server-to-reduce-token-usage) How MinniMemoryMCP cuts the memory tokens your agent loads on every turn, and how to install it.

Updated 2026-11-27 · Minni Labs

- [Context engineering for coding agents: what goes in every turn](https://minniai.com/learn/context-engineering-for-coding-agents) Deciding what your coding agent reads on every turn, what it reads on demand, and what it never needs.

Updated 2026-11-27 · Minni Labs

- [Prompt caching for coding agents: cache reads, cache writes and what breaks them](https://minniai.com/learn/prompt-caching-for-coding-agents) How prompt caching works in a coding agent, why cache reads dominate the bill, and how to keep the cache warm.

Updated 2026-11-27 · Minni Labs

- [Open-LLM coding agents: OpenCode, Aider, Cline, Goose and MinniCode compared](https://minniai.com/learn/open-llm-coding-agents) Five coding agents that run on open LLMs: where they run, which models, what they ask before they act.

Updated 2026-11-25 · Minni Labs

- [Claude Code alternatives that run on open LLMs](https://minniai.com/learn/claude-code-alternatives-open-llm) When an open-LLM agent is worth the move, when to keep Claude Code, and what comes across with you.

Updated 2026-11-25 · Minni Labs

- [How to run a coding agent on free, open models](https://minniai.com/learn/run-a-coding-agent-on-free-open-models) What a free key gets you, what a local model can do, and where the tokens go.

Updated 2026-11-25 · Minni Labs

- [Get a free NVIDIA API key for a coding agent](https://minniai.com/learn/free-nvidia-api-key-for-a-coding-agent) Where the key comes from, where to keep it, and how to run a coding agent on it.

Updated 2026-11-07 · Minni Labs

- [Claude Code usage limit reached: what to do, and how to hit it less](https://minniai.com/learn/claude-code-usage-limit-reached) What each limit message means, what to do now, and how to send less every turn.

Updated 2026-11-16 · Minni Labs

- [CLAUDE.md too long: what Claude Code does with it, and how to split it](https://minniai.com/learn/claude-md-too-long) What a long CLAUDE.md costs, the real size limits, and four ways to cut it.

Updated 2026-11-16 · Minni Labs

- [Claude Code context window keeps filling up: why it compacts, and what to do](https://minniai.com/learn/claude-code-context-window-full) What fills the window, what compaction keeps, and how to compact less often.

Updated 2026-11-16 · Minni Labs

- [How to reduce Codex token usage](https://minniai.com/learn/reduce-codex-token-usage) Where Codex spends tokens, and seven ways to spend fewer.

Updated 2026-11-16 · Minni Labs

- [Codex usage limits: why they drain and how to use fewer tokens](https://minniai.com/learn/codex-usage-limits) How the windows work, how to check what is left, and what uses the allowance up.

Updated 2026-11-11 · Minni Labs

- [AGENTS.md too large: what Codex cuts off and how to split it](https://minniai.com/learn/agents-md-too-large) The 32 KiB cap, how to see which files load, and five ways back under it.

Updated 2026-11-11 · Minni Labs

- [How to lower a Claude Code or Codex API bill](https://minniai.com/learn/lower-claude-code-codex-api-bill) What a coding agent bills on an API key, and the levers that move it.

Updated 2026-11-16 · Minni Labs

- [Why Claude Code sessions get expensive](https://minniai.com/learn/why-claude-code-sessions-get-expensive) Every turn re-sends the whole session. What makes that grow.

Updated 2026-11-05 · Minni Labs

- [Claude Code memory: CLAUDE.md vs MinniMemoryMCP](https://minniai.com/learn/claude-code-memory-claude-md-vs-minnimemorymcp) What belongs in CLAUDE.md, and splitting the rest out by hand or with a tool.

Updated 2026-11-16 · Minni Labs

- [MinniMemoryMCP vs Mem0, Zep, supermemory and Letta](https://minniai.com/learn/minnimemorymcp-vs-mem0-zep-supermemory-letta) Four tools add memory to an agent. MinniMemoryMCP cuts what the agent already loads. When each fits.

Updated 2026-11-16 · Minni Labs

- [How Claude Code remembers across sessions](https://minniai.com/learn/claude-code-memory-across-sessions) What carries over between sessions, what does not, and how to keep it small.

Updated 2026-11-16 · Minni Labs

- [Where Claude Code keeps its memory](https://minniai.com/learn/claude-code-memory-directory) Every memory path on your machine, what each file is for, and which ones load every turn.

Updated 2026-11-07 · Minni Labs

- [What a Windows PC optimization agent should and should not touch](https://minniai.com/learn/what-a-pc-optimization-agent-should-touch) The settings worth changing, the ones that are placebo, and the ones that break things.

Updated 2026-10-25 · Minni Labs

---

Index for agents: https://minniai.com/llms.txt. Doing a task: https://minniai.com/agents.md
