A high-performance CLI proxy that compresses dev command output by 60-90% before it reaches the LLM context. Single Rust binary, 100+ supported commands — better reasoning, longer sessions, lower costs.
brew install rtk curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh cargo install --git https://github.com/rtk-ai/rtk rtk init -g What it does
LLM coding assistants pour verbose CLI output (git log, pytest, npm test, directory trees) straight into the context window and burn tokens on noise — boilerplate, repetition, irrelevant progress. RTK intercepts those outputs before they reach the model and compresses them by 60–90%, so the same context window holds a longer session at lower cost.
Features
- 100+ supported commands — git, cargo, npm, pytest, docker, AWS CLI, kubectl, with domain-specific compression per tool
- Smart filtering — strips noise and boilerplate
- Grouping — aggregates similar items
- Truncation — preserves relevant context
- Deduplication — collapses repeated lines
- Auto-rewrite hook — transparently rewrites commands to RTK equivalents
rtk gain/rtk discover— analyze token savings and command coverage- Tee recovery — full output is saved on failure so the LLM can re-read it
Supported AI tools
Claude Code (PreToolUse hook), GitHub Copilot (VS Code/CLI), Cursor, Gemini CLI, Codex, Windsurf, Cline / Roo Code, OpenCode, Kilo Code, Google Antigravity.
Before / After
Before: git log, pytest, npm test output flows into the LLM context unfiltered — the window fills fast, sessions stay short, costs add up.
After: One rtk init -g registers the hook in Claude Code — output reaches the model already compressed by 60–90%, sessions run longer, costs drop.
When to use it
- Long debugging sessions where repeated test runs flood the context window.
- Large monorepos where verbose commands (
git log,git status, directory trees) hit the LLM frequently. - Anyone trying to stretch a 5-hour limit, an API budget, or a fixed context window further.
Frequently Asked Questions
What is RTK?
A single Rust binary CLI proxy that compresses the output of 100+ dev commands (git, cargo, npm, pytest, docker, kubectl, AWS CLI, …) by 60-90% before it reaches the LLM context window.
Which AI tools does it work with?
Claude Code, GitHub Copilot (VS Code & CLI), Cursor, Gemini CLI, Codex, Windsurf, Cline / Roo Code, OpenCode, Kilo Code, and Google Antigravity.
How do I install it?
On macOS use `brew install rtk`. On Linux/macOS, the install script `curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh` works too. Rust users can `cargo install --git https://github.com/rtk-ai/rtk`. Then run `rtk init -g` to wire up the Claude Code hook.
Who is it for?
Developers running long coding sessions where verbose CLI output (git log, test results, directory trees) keeps flooding the LLM context, and anyone trying to stretch a token budget or rate limit further.
Is it free?
Yes — open source under the Apache-2.0 license.