rtk-ai/rtk
rtk
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
GitHub metrics
- Stars
- 83K
- +838 this week
- Forks
- 5.3K
- 30-day growth
- —
- Open issues
- 854
| Day | GitHub stars |
|---|---|
| 2026-10-04 | 82315 |
| 2026-10-10 | 82829 |
| 2026-10-13 | 83153 |
What it does
RTK (Rust Token Killer) is a command-line proxy that trims the terminal output of common developer commands before an AI coding agent reads it, so less of the agent's context fills up with noise.
It ships as one Rust binary. When an agent runs something like git status, a hook installed by rtk init swaps it for rtk git status, which returns a compact version: failing tests only, grouped lint errors, one-line git confirmations, shortened directory trees. The README lists filters for git, the GitHub CLI, test runners such as pytest, Jest and cargo test, linters, package managers, Docker, kubectl, AWS and Pulumi, and claims more than 100 supported commands with under 10 ms of added time. When a command fails, RTK keeps the full unfiltered output so the agent can fetch it with rtk recall instead of running the command again.
The project is careful about its own numbers. It says it cuts up to 90% of the bash output an agent reads, and states plainly that this does not mean a 90% smaller bill, since shell output is only part of the input tokens. Token counts in rtk gain are estimated as bytes divided by four because RTK has no tokenizer.
Why it matters
An agent reads whatever a shell command prints, including progress bars, passing tests and full diffs. RTK filters that at the source, per command, and the hook means the agent does not need to remember to call it. It covers 18 coding tools according to the README, including Claude Code, Cursor, Codex, Gemini CLI and Copilot. The authors also document where the savings stop, such as built-in agent tools that never pass through the shell.
Main features
- Compact output filters for git, gh, test runners, linters, Docker, kubectl and AWS
- Hooks rewrite agent shell commands to rtk equivalents automatically
- Saves full output of failed commands for later recall
- `rtk gain` reports estimated savings, with daily, history and JSON views
- `rtk discover` looks for commands that ran without RTK filtering
- Native Windows hook since v0.37.2; WSL also works
- Per-command exclusions and settings in a TOML config file
- Telemetry is off unless you opt in
Who it's for
- Developers running Claude Code, Cursor, Codex, Gemini CLI or Copilot on large repositories
- Teams watching token spend from agent sessions
- People who want shorter test, lint and git output in agent transcripts
Strengths
- Works through agent hooks, so commands are filtered without the agent changing its habits
- Supports a long list of agents, each with its own install flag
- Honest about what the percentages measure and how token counts are estimated
- Opt-in telemetry with a documented list of collected fields
Limitations
- The hook only sees Bash tool calls; Claude Code's built-in Read, Grep and Glob bypass it
- Savings figures in the README measure shell output, not total cost
- Token numbers are approximations based on bytes divided by four
- A different crate named rtk exists on crates.io, so `cargo install rtk` can fetch the wrong tool
Getting started
Homebrew is the README's recommended route, winget covers Windows, and there is a shell script for Linux and macOS. After installing, run rtk init -g (or the flag for your agent) and restart the agent.
brew install rtk
winget install rtk-ai.rtk
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
cargo install --git https://github.com/rtk-ai/rtk
Requirements: A single binary for macOS, Linux or Windows; some filters call ripgrep (`rg`), which should be on your PATH.
Always follow the official instructions in the README on GitHub. This overview is our summary, not a copy.
Sources
- rtk-ai/rtkRepositoryPrimarygithub.com
- RTK — Rust Token KillerOfficial sitePrimaryrtk-ai.app