High-performance CLI proxy that cuts up to 90% of the bash output your agent reads
Website • Install • Troubleshooting • Architecture • Discord
English • Francais • 中文 • 日本語 • 한국어 • Espanol • Português
rtk filters and compresses command outputs before they reach your LLM context. Single Rust binary, 100+ supported commands, <10ms overhead.
What RTK Does
RTK intercepts shell commands and compresses their output before your agent reads it.
| Operation | What RTK does to the output |
|---|---|
ls / tree |
Tree format with file counts instead of one line per entry |
cat / read |
Smart file reading: signatures and structure over full bodies |
grep / rg |
Truncates long lines, groups matches by file |
git status |
Compact stat format, grouped by state |
git diff |
Reduced context, headers stripped |
git log |
Hash, author and subject only |
git add/commit/push |
Confirmation line instead of full progress output |
cargo test / npm test |
Failures only, passing tests collapsed to a count |
ruff check |
Grouped by rule and file |
pytest |
Failures only, traceback trimmed |
go test |
NDJSON parsed, failures only |
docker ps |
Essential fields only |
How Savings Work
RTK cuts up to 90% of the bash output your agent reads. That is what RTK measures, and it is not the same as cutting your bill by 90%.
Bash output is one contributor to input tokens, alongside your prompt, the system prompt and conversation history. Input tokens are in turn only part of the bill, which also counts output tokens. The reduction dilutes at every step.
The token counts RTK reports are estimated as bytes / 4 — RTK ships no tokenizer, so the percentages are reliable but the absolute token numbers are approximate.
Full explanation: How RTK Savings Work
Installation
Homebrew (recommended)
brew install rtk
Quick Install (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
Installs to
~/.local/bin. Add to PATH if needed:echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc
Cargo
cargo install --git https://github.com/rtk-ai/rtk
Pre-built Binaries
Download from releases:
- macOS:
rtk-x86_64-apple-darwin.tar.gz/rtk-aarch64-apple-darwin.tar.gz - Linux:
rtk-x86_64-unknown-linux-musl.tar.gz/ `rtk-aar