Where coding-agent tokens go, and the tool for each
Most advice about cutting Claude Code, Cursor or Codex costs names a single tool. In practice the waste comes from five different places, and each has a different fix. Start by finding which one dominates your bill.
Short answer: filter shell output with RTK; compress large file reads, logs and tool results with SuperCompress (hosted) or Headroom (local); keep big MCP results out of the conversation with Context Mode; stop repeated codebase reads with NeuralMind; trim long sessions with /compact; and shorten replies with an output limit or Caveman.
Measure first
Before installing anything, look at one real session. In Claude Code, /cost shows what the session has spent; every provider console breaks usage down by model and day. Agents almost always read far more than they write, so input is usually the bigger lever. If a single tool call returns tens of thousands of tokens, that call is your first target.
1. Shell output
Test runs, builds, git log and package installs print far more than the agent needs. RTK rewrites shell commands to run through output filters built for each command. It only sees Bash calls, so the agent's own Read and Grep tools are untouched. Its 60–90% figures are the project's own estimates.
2. File reads, logs and tool output
This is where most sessions bleed: a 3,000-line log read to find one stack trace. Two approaches work. SuperCompress is hosted and query-aware: it keeps the original lines that answer the question the agent is working on and drops the rest, so errors, paths and IDs survive word for word. Headroom is open source and runs locally, picking a compressor for each content type and keeping originals retrievable. Choose by where you want the work done.
3. MCP and large tool results
One MCP call can return hundreds of kilobytes. Context Mode, an open-source MCP server, keeps the full result in a local sandbox and hands the model a compact, searchable version (its 98% figure comes from its own examples). SuperCompress also exposes an MCP tool, compress_context, that agents can call on any bulky result.
4. History and repeated reads
Long sessions re-send their whole history, and agents re-read the same files. Built-in /compact summarizes the session; it needs no install, but the summary is an extra model call and it rewrites detail. NeuralMind takes a different route, building persistent local memory of your codebase so the agent asks targeted questions instead of loading files (its 12–50× figures are self-reported).
5. Replies
Output usually costs more per token but there is far less of it. An output limit or one concise-style instruction gets most of the saving. Caveman makes replies terse; an independent JetBrains test measured 8.5% against an advertised 65%, so test it on your own work.
Combinations that make sense
| If most waste is… | Start with | Add |
|---|---|---|
| Logs, file reads, tool output | SuperCompress or Headroom | RTK for shell output |
| Big MCP results | Context Mode or SuperCompress's MCP tool | /compact on long sessions |
| Re-reading a large repo | NeuralMind | A compressor for logs |
| Long, wordy replies | Output limit | Caveman, if measured worthwhile |
Then run the same tasks with and without each tool and compare your bill per finished task. Fewer tokens do not always mean a smaller bill once caching, retries and extra turns are counted.
Further reading
Best Headroom alternatives · Best Caveman alternatives · Headroom vs Caveman vs SuperCompress
Disclosure: Arjun Shah builds SuperCompress and Loopy, so this guide is not neutral. Every other tool is described from its own documentation or public reporting, with links, and the guide says where another tool is the better choice. Check each project for current details before you decide.
FAQ
What is the best tool to reduce coding-agent token usage?
It depends on where your tokens go. For logs, file reads and tool output, SuperCompress (hosted) or Headroom (local). For shell output, RTK. For MCP results, Context Mode. For long sessions, /compact.
Do token-reduction tools work with Claude Code, Cursor and Codex?
Most do. RTK hooks into Bash calls, SuperCompress and Headroom install for several agents, and Context Mode works with any MCP-compatible agent. Check each project's supported list.
Is output or input the bigger cost for coding agents?
Usually input. Agents read logs, files and tool results far more than they write, so compressing what they read tends to save more than shortening replies.