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 useless data, which lowers costs and improves agent performance.

How it works

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

  1. Smart Filtering: Removes whitespace, comments, and boilerplate.
  2. Grouping: Aggregates similar items, such as grouping errors by type or files by directory.
  3. Truncation: Keeps essential context while cutting redundant lines.
  4. Deduplication: Collapses repeated log lines into counts.

It can be integrated via an auto-rewrite hook that transparently transforms commands (e.g., git status becomes rtk git status) or used as a standalone CLI tool.

Who it’s for

Developers using AI coding agents (such as Claude Code, Cursor, Windsurf, Cline, or Gemini CLI) who want to optimize their token usage and keep their agent's context clean.

Highlights

  • Broad Support: Supports over 100 commands across Git, AWS, Docker, Kubernetes, and various test runners (Pytest, Cargo, Jest, etc.).
  • Lighweight: Single Rust binary with less than 10ms of overhead.
  • Transparent Integration: Hook-based system that rewrites commands automatically for supported agents.
  • Analytics: Includes a rtk gain command to track token savings and visualize them via ASCII graphs.

Related

  • Dispatch
  • Project
  • Project
  • Project