RTK (Rust Token Killer) is a command-line proxy that sits between an AI coding agent and the shell. It intercepts commands and filters or compresses their output before the agent reads it, so less bash output enters the model context. It ships as a single Rust binary, covers 100+ commands, and adds under 10 ms of overhead per call.
Four strategies are applied per command type: filtering removes comments, whitespace, and boilerplate; grouping aggregates similar items (files by directory, errors by type); truncation keeps relevant context and cuts redundancy; and deduplication collapses repeated log lines with counts. For example, git log becomes hash, author, and subject only, cargo test and pytest show failures only with passing tests collapsed to a count, and ls becomes a tree with file counts.
The reported figure is a reduction of up to 90% in bash output, not in the total bill: shell output is one contributor to input tokens alongside the prompt, system prompt, and history, and input tokens are only part of the cost. Token counts are estimated as bytes / 4 because no tokenizer ships, so the percentages are reliable while absolute numbers are approximate.
With Claude Code and other hook-capable agents, an auto-rewrite hook rewrites Bash tool calls (git status becomes rtk git status) before execution, so the agent receives compact output without calling rtk explicitly. Built-in Read, Grep, and Glob tools bypass the hook. Supported agents include Claude Code, GitHub Copilot, Cursor, Gemini CLI, Codex, Windsurf, Cline, Roo Code, OpenCode, OpenClaw, Pi, Hermes, Mistral Vibe, Kilo Code, Google Antigravity, Kimi, and Factory Droid, wired through hooks, plugins, or rules files depending on what each agent exposes. When a command fails, the full unfiltered output is saved to a tee log so the model can read it without re-running the command.
Features
- Command coverage: file listing and reading, git, GitHub CLI, test runners (Jest, Vitest, Playwright, pytest, go test, cargo test, rake, RSpec), build and lint tools (ESLint, Biome, tsc, Next.js, Prettier, Cargo, ruff, golangci-lint, RuboCop, sbt), package managers, AWS CLI, Docker, kubectl, OpenShift, and Pulumi
- Smart file reading: rtk read returns signatures and structure over full bodies, with an aggressive level that strips bodies entirely
- Generic wrappers: rtk err, rtk test, rtk summary, and rtk proxy apply error filtering, failure-only output, heuristic summaries, or raw passthrough to any command
- Auto-rewrite hook: automatic Bash command rewriting for Claude Code and other agents, with exclude_commands to skip specific commands
- Failure tee: full raw output saved to a log on failure (modes: failures, always, never)
- Savings analytics: rtk gain summary, graph, history, daily breakdown, and JSON export; rtk discover finds missed opportunities; rtk session reports adoption across sessions
- Ultra-compact mode: -u switches to ASCII icons and inline format for further reduction
- Native Windows: since v0.37.2 the hook runs as a native binary command without a Unix shell; WSL behaves like Linux
- Opt-in telemetry: disabled by default; anonymous aggregate metrics only after explicit consent, with RTKTELEMETRYDISABLED=1 as a hard override
Runs in
Claude Code
Terminal-based agentic coding tool that reads your codebase and runs tasks through natural-language commands
Cline
Open-source coding agent with one engine behind VS Code, JetBrains, a headless CLI, an SDK, and a parallel Kanban board
Codex
Lightweight coding agent that runs in your terminal
Hermes
Self-improving AI agent with a learning loop that creates and refines skills, recalls past sessions, and runs across chat platforms