rtk

Single Rust binary that filters and compresses shell command output (git, tests, linters, etc.) before AI coding agents read it, with under 10ms overhead.

install

rtk (Rust Token Killer) is a CLI proxy that sits between an AI coding agent and the shell. It intercepts commands such as git status, cargo test or docker ps and compresses their output before it enters the LLM context. It ships as a single Rust binary, supports 100+ commands, and reports under 10ms overhead. The README claims up to 90% reduction in bash output, and notes that this is a reduction in bash output only, not in the total bill. Token counts are estimated as bytes / 4, so percentages are reliable while absolute numbers are approximate.

Compression uses four strategies applied per command type: smart filtering (removing comments, whitespace, boilerplate), grouping (files by directory, errors by type), truncation, and deduplication of repeated log lines with counts. Examples: git log keeps hash, author and subject; git push becomes a confirmation line; pytest, cargo test, go test and jest show failures only; ruff check, eslint and sqlfluff lint group results by rule and file; ls and tree produce a tree with file counts. Commands can also be called directly, for example rtk read file.rs -l aggressive, rtk grep, rtk gh pr list, rtk tsc, and rtk gain for a savings dashboard.

Setup is done with rtk init, which installs a hook for a specific agent: Claude Code / Copilot, Gemini CLI, Codex, Cursor, Windsurf, Cline / Roo Code, Kilo Code, Antigravity, Kimi, Pi, Hermes, Factory Droid, Trae and others. After restart, the agent's Bash calls are rewritten automatically (git status becomes rtk git status). The hook only applies to Bash tool calls, so built-in tools such as Claude Code's Read, Grep and Glob are not rewritten. It targets developers who run agentic coding tools and want smaller command output in context. It runs on macOS, Linux and Windows.

Installation

# via Homebrew
brew install rtk
# via winget
winget install rtk-ai.rtk
# via Cargo
cargo install --git https://github.com/rtk-ai/rtk

Alternatives & related tools

add a badge to your README

Maintain rtk? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/rtk.svg)](https://www.trmn.sh/tools/rtk?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/rtk?utm_source=badge"><img src="https://www.trmn.sh/badge/rtk.svg" alt="Featured on trmn" height="20"></a>