A 58K-star Rust binary that cuts your LLM bill by 80%
rtk sits between your AI agent and the shell, compressing command output before it ever hits context.

What it does
rtk is a CLI proxy that intercepts common developer commands—git status, cargo test, docker ps, aws ec2 describe-instances—and feeds your LLM a compressed, filtered version instead of raw terminal output. It claims 60–90% token savings across 100+ commands with under 10ms overhead. A single Rust binary, zero runtime dependencies, installed via Homebrew or a shell script.
The interesting bit
The real trick is the auto-rewrite hook: git status silently becomes rtk git status before execution, so your AI agent never sees the bloated original. The README is admirably blunt about what gets rewritten (Bash tool calls) and what does not (Claude Code’s built-in Read/Grep/Glob tools). That honesty is rarer than you’d think.
Key highlights
- Four compression strategies per command: smart filtering, grouping, truncation, deduplication
- Token analytics built in:
rtk gainshows savings stats,rtk gain --graphprints an ASCII chart - Supports Claude Code, Copilot, Gemini CLI, Codex, Cursor, Windsurf, Cline, and others via
rtk init -g rtk discoverhunts for missed savings opportunities across your recent sessions- Windows support exists but the README nudges you toward WSL for “the full hook system”
Caveats
- The 60–90% savings figures are estimates for “medium-sized TypeScript/Rust projects”; actual mileage varies
- Claude Code’s native file-reading tools bypass rtk entirely unless you switch to shell equivalents
- A name collision with “Rust Type Kit” on crates.io means
cargo install rtkmay install the wrong tool
Verdict Worth a look if you’re burning tokens on repetitive shell commands in agentic workflows. Skip it if your LLM usage is mostly chat-based or you already pay flat-rate for unlimited context.