rtk is a free, open source ai assisted coding project written in Rust and released under Apache-2.0. It has 80,883 GitHub stars, 5,130 forks and 1,642 open issues, and was last pushed 11 hours ago. On this registry it ranks #5 of 26 tracked projects in AI Assisted Coding, with 5 head-to-head comparisons available.

What is rtk?

rtk is an Apache-2.0 Rust CLI proxy that sits between an AI coding agent and the shell, filtering and compressing command output so 60-90% fewer tokens reach the model, and it is built for developers running agentic coding tools such as Claude Code, Cursor, or Codex against real repositories.

What it is

rtk is a single Rust binary with zero dependencies that intercepts the output of developer commands before it enters an LLM context window. It supports more than 100 commands and applies four strategies per command type: Smart Filtering, which removes noise such as comments, whitespace, and boilerplate; Grouping, which aggregates similar items such as files by directory or errors by type; Truncation, which keeps relevant context and cuts redundancy; and Deduplication, which collapses repeated log lines with counts. Installation is available through Homebrew, winget, a shell install script, Cargo, and pre-built binaries for macOS, Linux, and Windows.

The project lives in the agentic-coding ecosystem, alongside tools such as Claude Code, Copilot, Gemini CLI, Codex, Cursor, Windsurf, Cline and Roo Code, Kilo Code, Google Antigravity, Kimi AI, Pi, Oh My Pi, Hermes, and Factory Droid. What it replaces is the raw, unfiltered command output that would otherwise pass straight from the shell into the model. Hook-based agents rewrite Bash calls before execution, so a call to git status becomes rtk git status and the agent receives compact output without invoking rtk explicitly.

Key capabilities

  • Hook-based command rewriting installed per agent with rtk init -g, plus variants such as rtk init -g --gemini, rtk init -g --codex, and rtk init --agent cline.
  • Plugin API integration for plugin-based agents including Hermes, which rewrites commands before execution rather than through a hook.
  • Explicit subcommands rtk read, rtk grep, and rtk find for workflows the Bash hook does not cover, such as Claude Code's built-in Read, Grep, and Glob tools.
  • A savings dashboard available through rtk gain, and version verification through rtk --version, which reports rtk 0.28.2 in the documented example.
  • Per-agent init targets covering Cursor, Windsurf, Kilo Code, Google Antigravity, Kimi AI, Pi, Oh My Pi, Hermes, and Factory Droid.
  • Distribution channels including brew install rtk, winget install rtk-ai.rtk, a Linux/macOS install.sh that installs to ~/.local/bin, cargo install --git https://github.com/rtk-ai/rtk, and release archives such as rtk-x86_64-apple-darwin.tar.gz and rtk-x86_64-pc-windows-msvc.zip.
  • Prompt-cache safety: filtering happens once per command, the result is stored in history and cached normally, and smaller outputs also mean cheaper cache writes and reads.

Who uses it and how

  • Developers using Claude Code or Copilot who want routine Bash calls to consume less context on every turn.
  • Teams standardized on Gemini CLI, Codex, Cursor, Windsurf, Cline and Roo Code, Kilo Code, Google Antigravity, Kimi AI, Pi, OMP, Hermes, or Factory Droid, each of which has a dedicated init target.
  • Windows users installing through winget and running rtk from Command Prompt, PowerShell, or Windows Terminal, or inside WSL, where the full hook system works natively.
  • Long agentic sessions where repeated log lines and boilerplate would otherwise dominate the context window, which is the case the Deduplication and Grouping strategies target.

Getting started

The recommended install is brew install rtk, with winget install rtk-ai.rtk on Windows, a curl script install to ~/.local/bin on Linux and macOS, or cargo install --git https://github.com/rtk-ai/rtk. After installing, run rtk init -g for the relevant agent and restart that tool.

How it compares

This registry names no competing token-reduction proxy, and rtk stands alone here. The tools listed in its documentation, such as Claude Code, Cursor, and Codex, are the agents it integrates with rather than products it replaces.

When to use it — and when not

Installation carries no database, storage, or mail server to operate, but every agent you use needs its own rtk init run and a restart, and the hook only fires on Bash tool calls, so Read, Grep, and Glob workflows still need explicit rtk read, rtk grep, or rtk find calls. Avoid installing from crates.io, where an unrelated project also named rtk exists and rtk gain will fail, and avoid the project if you need automatic coverage of non-Bash built-in tools or if 1,642 open issues signals more churn than your team will tolerate.

project readme (upstream, from github) — read inline

RTK - Rust Token Killer

High-performance CLI proxy that cuts up to 90% of the bash output your agent reads

CI Release License: Apache 2.0 Discord Homebrew

WebsiteInstallTroubleshootingArchitectureDiscord

EnglishFrancais中文日本語한국어EspanolPortuguês


rtk filters and compresses command outputs before they reach your LLM context. Single Rust binary, 100+ supported commands, Full explanation: How RTK Savings Work

Installation

Homebrew (recommended)

brew install rtk

winget (Windows)

Easiest way to install on Windows — one command, no PATH setup needed:

winget install rtk-ai.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-aarch64-unknown-linux-gnu.tar.gz
  • Windows: rtk-x86_64-pc-windows-msvc.zip

Windows users: Extract the zip and place rtk.exe somewhere in your PATH (e.g. C:\Users\\.local\bin). Run RTK from Command Prompt, PowerShell, or Windows Terminal — do not double-click the .exe (it will flash and close). The full hook system works natively on Windows (and in WSL). See Windows setup below for details.

Verify Installation

rtk --version   # Should show "rtk 0.28.2"
rtk gain        # Should show the savings dashboard

Name collision warning: Another project named "rtk" (Rust Type Kit) exists on crates.io. If rtk gain fails, you have the wrong package. Use cargo install --git above instead.

Quick Start

# 1. Install for your AI tool
rtk init -g                     # Claude Code / Copilot (default)
rtk init -g --gemini            # Gemini CLI
rtk init -g --codex             # Codex (OpenAI)
rtk init -g --agent cursor      # Cursor
rtk init -g --agent windsurf    # Windsurf
rtk init --agent cline          # Cline / Roo Code
rtk init --agent kilocode       # Kilo Code
rtk init --agent antigravity    # Google Antigravity
rtk init --agent kimi           # Kimi AI
rtk init -g --agent pi          # Pi
rtk init --agent omp            # Oh My Pi (OMP)
rtk init --agent hermes         # Hermes
rtk init -g --agent droid       # Factory Droid

# 2. Restart your AI tool, then test
git status  # Automatically rewritten to rtk git status

Hook-based agents rewrite Bash commands (e.g., git status -> rtk git status) before execution. Plugin-based agents, including Hermes, use their plugin API to rewrite commands before execution. The agent receives compact output without needing to call rtk explicitly.

Important: the hook only runs on Bash tool calls. Claude Code built-in tools like Read, Grep, and Glob do not pass through the Bash hook, so they are not auto-rewritten. To get RTK's compact output for those workflows, use shell commands (cat/head/tail, rg/grep, find) or call rtk read, rtk grep, or rtk find directly.

How It Works

  Without rtk:                                    With rtk:

  Claude  --git status-->  shell  -->  git         Claude  --git status-->  RTK  -->  git
    ^                                   |            ^                      |          |
    |         full raw output           |            |  compact output      | filter   |
    +-----------------------------------+            +------- (filtered) ---+----------+

Four strategies applied per command type:

  1. Smart Filtering - Removes noise (comments, whitespace, boilerplate)
  2. Grouping - Aggregates similar items (files by directory, errors by type)
  3. Truncation - Keeps relevant context, cuts redundancy
  4. Deduplication - Collapses repeated log lines with counts

Does RTK break Claude's prompt cache? No. RTK filters output once per command. The result is stored in history and cached normally on subsequent API calls, so the cache keeps working as expected. Smaller outputs also mean cheaper cache writes and reads. See Troubleshooting for details.

Commands

Percentages below are reductions in bash output, not reductions in your bill. See How Savings Work.

Files

rtk ls .                        # Compact directory tree
rtk read file.rs                # Smart file reading
rtk read file.rs -l aggressive  # Signatures only (strips bodies)
rtk smart file.rs               # 2-line heuristic code summary
rtk find "*.rs" .               # Compact find results
rtk grep "pattern" .            # Grouped search results
rtk diff file1 file2            # Condensed diff (exit 1 if files differ)

Git

rtk git status                  # Compact status
rtk git log -n 10               # One-line commits
rtk git diff                    # Condensed diff
rtk git add                     # -> "ok"
rtk git commit -m "msg"         # -> "ok abc1234"
rtk git push                    # -> "ok main"
rtk git pull                    # -> "ok 3 files +10 -2"

GitHub CLI

rtk gh pr list                  # Compact PR listing
rtk gh pr view 42               # PR details + checks
rtk gh issue list               # Compact issue listing
rtk gh run list                 # Workflow run status

Test Runners

rtk jest                        # Jest compact (failures only)
rtk vitest                      # Vitest compact (failures only)
rtk playwright test             # E2E results (failures on

readme truncated — read the full docs on github

Frequently asked questions

Is rtk free to use?

rtk is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does rtk do?

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

What is rtk written in?

rtk is primarily written in Rust. Its source is publicly available at https://github.com/rtk-ai/rtk, and it has 80,883 GitHub stars.