rtk-ai/rtk

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

What it solves

RTK (Rust Token Killer) reduces the amount of text (tokens) that AI agents read from shell command outputs. By filtering out noise, boilerplate, and redundant information, it prevents LLM context windows from being filled with irrelevant data, which can lower costs and improve agent performance.

How it works

RTK acts as a high-performance CLI proxy. It intercepts shell commands and applies four primary strategies to compress the output before it reaches the AI agent:

  1. Smart Filtering: Removes comments, whitespace, and boilerplate.
  2. Grouping: Aggregates similar items, such as grouping files by directory or errors by type.
  3. Truncation: Cuts redundancy while keeping relevant context.
  4. Deduplication: Collapses repeated log lines.

It can be used as a standalone CLI tool or via an auto-rewrite hook that transparently converts commands (e.g., git status becomes rtk git status) for supported AI tools like Claude Code, Cursor, and Windsurf.

Who it’s for

Developers using AI coding agents (such as Claude Code, Cursor, Windsurf, Cline, and others) who want to reduce token usage and keep their agent's context focused on essential information.

Highlights

  • Broad Support: Supports over 100 commands across files, Git, GitHub CLI, test runners (Jest, Pytest, Cargo), build tools, and cloud providers (AWS, Docker, Kubernetes).
  • High Performance: Written in Rust with less than 10ms of overhead.
  • Transparent Integration: Auto-rewrite hooks allow agents to use RTK without the agent needing to call it explicitly.
  • Built-in Analytics: Includes a rtk gain command to track token savings and visualize them via ASCII graphs.
  • Cross-Platform: Native support for macOS, Linux, and Windows.

Related

  • Project
  • Dispatch
  • Project
  • Project