| name | rtk-token-killer |
| license | UNLICENSED |
| description | Install and configure RTK (Rust Token Killer) — a high-performance CLI proxy that reduces LLM token consumption by 60-90%. Automatically rewrites shell commands to their rtk equivalents via hooks. Use when setting up a new dev environment or when token optimization is needed. Do NOT use when raw unfiltered output is required (use rtk proxy for that). |
| metadata | {"version":"1.0.0","author":"afonsoft","visibility":"public","rt":"Portais","origin":"rtk-ai/rtk"} |
RTK — Rust Token Killer
High-performance CLI proxy that reduces LLM token consumption by 60-90% through smart filtering, grouping, truncation, and deduplication. Single Rust binary, 100+ supported commands, <10ms overhead.
Installation
Pre-built binary
RTK detects OS and architecture automatically (x86_64 and aarch64 supported):
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
Installs to ~/.local/bin. Ensure PATH includes it:
export PATH="$HOME/.local/bin:$PATH"
Verify
rtk --version
rtk gain
Hook Setup (per IDE)
After installing the binary, configure hooks for your IDE:
Claude Code
rtk init -g
Cursor / Devin Desktop
rtk init -g --agent cursor
rtk init -g --agent devin
Codex / Gemini
rtk init -g --codex
rtk init -g --gemini
Google Antigravity
rtk init --agent antigravity
Devin
Devin is not officially supported by RTK. The install.sh script installs the RTK binary globally, but you'll need to manually configure RTK for Devin if needed.
How It Works
Without rtk: With rtk:
Claude --git status--> shell --> git Claude --git status--> RTK --> git
^ ~2000 tokens | ^ ~200 tokens |filter|
+---------------------------+ +--------------------+------+
Four strategies per command:
- Smart Filtering — removes noise (comments, whitespace, boilerplate)
- Grouping — aggregates similar items (files by directory, errors by type)
- Truncation — keeps relevant context, cuts redundancy
- Deduplication — collapses repeated log lines with counts
Key Commands
| Command | Savings | Description |
|---|
rtk git status | -80% | Compact git status |
rtk git diff | -75% | Condensed diff |
rtk git log | -80% | One-line commits |
rtk cargo test | -90% | Failures only |
rtk ls | -80% | Token-optimized tree |
rtk read file.rs | -70% | Smart file reading |
rtk grep pattern . | -80% | Grouped search |
rtk gain | — | Token savings analytics |
rtk discover | — | Find missed savings |
Auto-Rewrite Hook
The hook transparently intercepts Bash commands and rewrites them to rtk equivalents:
git status → rtk git status
cargo test → rtk cargo test
cat file.rs → rtk read file.rs
Result: 100% rtk adoption across all conversations and subagents, zero effort.
Bypass
When unfiltered output is needed:
rtk proxy git log --oneline -20
Proxy Configuration
Behind corporate proxy, set before install: