RTK — Rust Token Killer
A token-optimized CLI proxy for agentic coding tools. Runs your dev commands, strips the output to what the model actually needs, and reports the saving.
Coding agents spend an enormous share of their context on command output that
carries very little signal — build logs, git status boilerplate, dependency
trees, test runners narrating every passing case. You pay for all of it.
RTK sits in front of those commands. It runs the real thing, filters the output down to the load-bearing parts, and hands that to the model instead.
#Usage
The core idea is that it's a drop-in prefix. Same command, less output:
rtk git status
rtk cargo buildIn Claude Code it doesn't even need the prefix — a hook rewrites commands
transparently, so git status becomes rtk git status with no overhead in the
prompt itself.
#Measuring the saving
A tool that claims a reduction should be able to show it, so accounting is built in rather than bolted on:
rtk gain # token savings analytics
rtk gain --history # per-command history with savings
rtk discover # scan session history for missed opportunities
rtk proxy <cmd> # run unfiltered, for debugging the filter itselfrtk discover is the one that surprised me most in daily use: pointing it at
existing history surfaces the commands where filtering would have paid off but
wasn't applied.
#Notes
- Written in Rust, so the proxy overhead stays well below the latency of the command it's wrapping.
- Filters are per-command rather than generic —
cargooutput andgitoutput fail in different ways and need different rules. rtk proxyexists because the hardest bug class here is a filter that removes something that mattered. Having an unfiltered escape hatch makes that debuggable.