A high-performance CLI proxy that filters and compresses command outputs before they reach your LLM context. Save 60-90% of tokens on every session.
Real outputs from the rtk codebase. 10M+ tokens saved, 89% average reduction over 2,500+ commands.
rtk sits between your shell and your LLM, compressing everything automatically.
Removes noise — comments, whitespace, boilerplate — keeping only what matters for your LLM.
Aggregates similar items: files by directory, errors by type, logs by pattern.
Keeps relevant context, cuts redundancy. Your LLM sees the signal, not the noise.
Collapses repeated log lines with counts. 500 identical errors become one line.
Transparently intercepts Bash commands and rewrites them to rtk equivalents. Zero config, 100% adoption.
rtk gain shows savings stats, graphs, and history. rtk discover finds missed opportunities.
Measured on real-world Claude Code sessions.
| Operation | Standard | With rtk | Savings |
|---|---|---|---|
ls / tree |
File listings with metadata | Filtered tree, grouped | -80% |
cat / read |
Full file contents | Signatures only (aggressive) | -70% |
grep / rg |
Verbose match output | Grouped by file, compact | -80% |
git status |
Multi-line with hints | One-line per category | -80% |
git diff |
Full unified diff | Ultra-condensed diff | -75% |
git log |
Verbose commit history | Compact one-liners | -80% |
git add/commit/push |
Multi-line confirmations | ok ✓ abc1234 |
-92% |
test runners |
Full test output | Failures only | -90% |
docker ps |
Wide table with IDs | Compact container list | -80% |
rtk is written in Rust for maximum performance. Choose your install method.
One-liner for Linux & macOS
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
From GitHub or crates.io
cargo install --git https://github.com/rtk-ai/rtk
rtk init --global
This installs a PreToolUse hook that transparently rewrites Bash commands to rtk equivalents. Zero token overhead, 100% adoption.
Everything you need, from file browsing to Kubernetes logs.
rtk ls .Filtered treertk read file.rsSmart readrtk find "*.rs"Compact findrtk grep "pattern"Grouped greprtk diff f1 f2Condensed diffrtk git statusCompact statusrtk git logOne-line commitsrtk git diffCondensed diffrtk git commit -m "msg"ok ✓ abc1234rtk git pushok ✓ mainrtk test <cmd>Failures onlyrtk err <cmd>Errors onlyrtk tscTS errors groupedrtk lint eslint .Violations groupedrtk vitest runCompact outputrtk json config.jsonStructure onlyrtk depsDependencies summaryrtk envVars filteredrtk gainSavings statsrtk discoverMissed savingsrtk docker psCompact listrtk docker logs <c>Deduplicatedrtk kubectl podsCompact podsrtk kubectl logs <p>Deduplicatedrtk curl <url>Auto JSON schemartk gh pr listCompact PRsrtk cargo buildCargo compactrtk prisma migrateNo ASCII artrtk next buildNext.js compactInstall rtk, save tokens, ship faster.