// AI Best Practices

RTK — Rust Token Killer

A CLI proxy written in Rust that filters command output before it reaches Claude. Designed and maintained by rtk-ai — I'm just a grateful user.

Tool designed by rtk-ai· 2026-05-09

What it is

RTK (Rust Token Killer) sits between the shell command Claude wants to run and the terminal. It intercepts the output, summarises it when repetitive, keeps errors intact, strips progress banners, and only returns to the model what's useful.

The idea: Claude doesn't need to read 4000 lines of Webpack logs, it needs the summary and the errors. RTK does that filtering work before tokens are consumed.

How it works

RTK registers a Claude Code hook that rewrites certain commands: `git status` becomes `rtk git status`, `npm test` becomes `rtk npm test`, etc. The transformation is transparent, with zero token overhead — it's just an indirection.

On the implementation side, RTK runs the command, reads the output, applies filtering rules (summaries, dedup of repeated warnings, removal of progress bars, ANSI colour cleanup) and returns the result to the calling shell. Errors are preserved in full.

rtk rg "CandidateImport" src --line-number
rtk git diff
rtk npm test -- CandidateImport

How to install it

Follow the official repo README — there's a pre-built binary for Linux, macOS and Windows. After installation, verify the command:

rtk --version    # rtk X.Y.Z
rtk gain         # shows cumulative savings
which rtk        # verify the binary

How I use it daily

Concretely, since RTK has been in place, I no longer see torrents of Webpack or Vite logs flooding my Claude conversation. Errors still show up — clearly visible — but without the 200 deprecated-dependency warnings that used to drown them.

On repetitive dev operations (build, tests, git status, npm install), `rtk gain` shows savings of 60 to 90% on input token consumption. It's a gain in both cost and answer quality — Claude reasons better on clean output.

Don't ask Claude to read everything to feel 'reassured'. Give it a method to find what matters.

My internal memo

Sources & credits

RTK is designed and maintained by `rtk-ai`. The idea of filtering shell output before the model, the Rust implementation, the hook system — all from them. This article reflects my usage.

Sources & credits