One Command Saved Me 2.8M Claude Code Tokens hero

One Command Saved Me 2.8M Claude Code Tokens

6 min read

Every command Claude Code runs dumps its output into the context window. A passing test suite, a lint run, an ls of an assets folder. Most of that output is noise, but Claude reads all of it. It clutters the conversation and pushes it toward compaction sooner.

RTK (Rust Token Killer) fixes this. Itโ€™s a CLI proxy that sits between Claude and your shell and filters command output down to what the agent actually needs.

Setup

I installed it with Homebrew seven months ago. Since then, all Iโ€™ve done is keep it up to date along with the rest of my system dependencies.

Terminal window
brew install rtk
rtk init -g

rtk init -g handles the setup for you, so thereโ€™s nothing to paste. For reference, this is the PreToolUse hook it adds to your global Claude Code settings:

{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "rtk hook claude" }]
}
]
}
}

Thatโ€™s it.

It just works

This is the part I like most. I donโ€™t think about RTK and neither does Claude. When Claude runs git status, the hook rewrites it to rtk git status before it executes. Same for grep, ls, go test, eslint, gh, and a long list of other commands. Claude gets the compact output, and nobody had to change their habits.

Hereโ€™s git status in this blogโ€™s repo while I was writing this post. Without RTK, Claude reads all of this:

On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
content/attachments/posts/one-command-saved-me-2-8m-claude-code-tokens/
content/posts/one-command-saved-me-2-8m-claude-code-tokens.md
nothing added to commit but untracked files present (use "git add" to track)

With RTK, it reads this:

* main...origin/main
?? content/attachments/posts/one-command-saved-me-2-8m-claude-code-tokens/
?? content/posts/one-command-saved-me-2-8m-claude-code-tokens.md

Same information, without the hints written for humans. Claude already knows how to git add a file.

What if RTK cuts something Claude actually needs? When it truncates output, it saves the full version to a log file and leaves a note telling Claude where to find it:

[see remaining: tail -n +1 "~/Library/Application Support/rtk/tee/1795025400_ls-hidden.log"]

Claude can read the rest whenever it needs to, and rtk bypass <cmd> runs any command with no filtering at all.

I stopped babysitting terminal output. The cost is about 321ms per command on average, which Iโ€™ve never noticed.

The numbers

RTK tracks everything it filters. Run rtk gain to see your savings:

RTK Token Savings (Global Scope)
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Total commands: 33747
Input tokens: 10.8M
Output tokens: 8.1M
Tokens saved: 2.8M (25.5%)
Total exec time: 155m21s (avg 321ms)
Efficiency meter: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 25.5%
Excluded: 300 oversized outputs (input past the ~30k-char agent cap)
By Command
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Command Count Saved Total% Time Impact
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1. rtk read 6272 2.2M 29.0% 0ms โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
2. rtk grep 11184 1.7M 6.9% 408ms โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘
3. rtk go test ./... 29 1.5M 100.0% 1.7s โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘
4. rtk lint eslint 4 1.0M 99.9% 8.1s โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘
5. rtk ls Assets 14 308.7K 98.7% 27ms โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Thatโ€™s 2.8M tokens saved across almost 34,000 commands, and itโ€™s only the last 90 days, since RTK keeps 90 days of history by default. Iโ€™ve been running it since April 2026, so the real number is higher.

2.8M is also the conservative number. Claude Code cuts off any command output past about 30,000 characters, so RTK leaves those 300 oversized outputs out of the total. It only takes credit for tokens Claude would actually have read. The per-command rows still include those big outputs, so donโ€™t add them up. The total at the top is the real number.

Some commands get trimmed, and some get almost erased:

  • Trimmed. read and grep cut 7โ€“29% per call, but Claude runs them constantly. Thatโ€™s over 17,000 calls between them.
  • Erased. go test and eslint output shrinks by more than 99%. A passing test suite doesnโ€™t need hundreds of lines of ok output, so RTK collapses it to a summary. Claude gets the part that matters.

Those savings also compound. Command output stays in the context for the rest of the session, so itโ€™s sent again with every turn after it. Trimming it once keeps the whole conversation lighter.

Putting 2.8M in perspective

After this post went out, someone asked me how much RTK actually cuts into my usage window. Fair question, so I ran rtk cc-economics, which compares RTKโ€™s savings against your Claude Code usage:

Token breakdown:
Input: 37.4M
Output: 8.5M
Cache writes: 45.5M
Cache reads: 1698.9M
RTK commands: 33775
Tokens saved: 2.8M

RTK estimates thatโ€™s 0.9% of my total usage. Under 1% looked small at first, until I saw where my usage actually goes: 1.7 billion cache-read tokens. Every turn, Claude Code re-sends the whole conversation, and that dwarfs everything else. RTK only touches one slice of it, the command output, and only for commands it supports.

So 2.8M isnโ€™t a big dent in my usage window, and I wonโ€™t pretend it is. What it is: 2.8M tokens of noise that never made it into a conversation. Within the slice RTK touches, it cuts a quarter overall and more than 99% on the noisiest commands. Thatโ€™s the part I notice day to day, a cleaner context I donโ€™t have to babysit. The estimate also prices each saved token once, so it doesnโ€™t count the turns where that output would have been re-read.

The percentage only grows as RTK supports more commands, which is where you come in.

Finding what it missed

RTK doesnโ€™t support every command. When it sees one it doesnโ€™t know, it passes the output through untouched, so nothing breaks. You just donโ€™t get the savings. rtk discover scans your Claude Code history and shows you both the commands RTK doesnโ€™t handle yet and the ones that slipped past it:

Scanned: 24 sessions (last 30 days), 2304 Bash commands
Already using RTK: 856 commands (37.2%)
MISSED SAVINGS -- Commands RTK already handles
Command Count RTK Equivalent Est. Savings
grep -n 46 rtk grep ~11.2K tokens
cat 20 rtk read ~8.1K tokens
curl -s 20 rtk curl ~3.3K tokens
git add 17 rtk git ~3.0K tokens
ls -la 16 rtk ls ~2.8K tokens
Total: 176 commands -> ~33.1K tokens saveable

In my last 30 days, 37% of my Bash commands went through RTK. Most of the rest were commands RTK doesnโ€™t support yet, like Python heredocs, pnpm build, and sips, and those passed through as normal. The commands it could have filtered but missed only add up to about 33K tokens.

The bigger opportunity is the unsupported list. Every command on it is a filter waiting to be written, and discover points you to the issue tracker to request one. You donโ€™t need to know Rust to start, either. RTK reads custom filters from a filters.toml, globally or per project in .rtk/filters.toml, where you can match a command, strip noisy lines, and cap the output length. For anything more involved, rtk plugins new scaffolds a Rust plugin. If a filter works well for you, send it upstream so everyone gets the savings.

A few more commands

  • rtk gain --history shows recent commands and how much each one saved.
  • rtk bypass <cmd> runs a command without filtering, which helps when you need to see the raw output.
  • If rtk gain fails, check which rtk. Thereโ€™s an unrelated Rust Type Kit that also installs as rtk.

Wrapping up

Most tools that save tokens ask you to change how you work. RTK doesnโ€™t. I installed it, ran one command, and seven months later itโ€™s still saving me tokens on every session. It wonโ€™t double your usage window, but it keeps every conversation cleaner, and it gets better with every command the community adds. If you use Claude Code, itโ€™s an easy win.

Check out RTK on GitHub, install it, and start saving tokens for yourself. And while youโ€™re there, give the project a star.

If you want more ways to tune Claude Code, check out Tuning Your Claude Code Settings.

Sign-Up for New Posts

Stay in the loop and get the latest blog posts about Claude Code sent to your inbox.

Or use the

RSS Feed