rtk-token-killer — Summary
One-liner: Rust binary that acts as a command proxy, intercepting CLI tool output before it reaches Claude Code's context window and compressing it 60-90% through smart filtering, grouping, truncation, and deduplication.
Identity
| Field | Value |
|---|---|
| Slug | rtk-token-killer |
| GitHub | https://github.com/rtk-ai/rtk |
| Stars | 54,590 |
| License | Apache-2.0 |
| Language | Rust |
| Version analyzed | 0.40.0 |
| Maintainer status | Active |
| Contributors | 30 |
What It Does
rtk (Real Token Killer) is a Rust-based CLI command proxy that sits between Claude Code's Bash tool and the underlying shell commands. When a developer runs rtk init -g, it installs a PreToolUse hook into Claude Code's hook system. That hook intercepts every Bash command Claude attempts to execute and rewrites it to the rtk <cmd> equivalent, which runs the real command but filters, condenses, and deduplicates the output before returning it to Claude.
The result is 60-90% token reduction on command output while preserving all decision-relevant information. Token savings are tracked in SQLite and surfaced via analytics commands.
Key Capabilities
- Command proxy architecture: Each CLI family (git, jest, cargo, npm, kubectl, etc.) has a dedicated filter module in
src/cmds/*/ - PreToolUse hook integration:
hooks/claude/rtk-rewrite.shwraps Bash tool calls; exit codes signal rewrite/no-equivalent/deny/ask - Token analytics:
rtk gain,rtk gain --graph,rtk gain --daily,rtk gain --history,rtk gain --all --format json - Session tracking:
rtk sessionshows current session savings - Discoverability:
rtk discovershows which commands in the current repo can be optimized - Custom filters:
.rtk/filters.tomlper-project configuration - Multi-tool init:
rtk init -g(Claude Code/Copilot),--geminiflag,--codexflag, or--agent cursor/windsurf/cline/kilocode/antigravity/hermes - Package managers:
brew install rtk,cargo install rtk, prebuilt binaries
Scope
Single-purpose utility. No orchestration, no AI calls, no multi-agent patterns. Pure output compression pipeline with hook-based integration.