rtk-ai/rtkPublic

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

AI summary: A CLI proxy that drastically reduces LLM token consumption on common development commands.

Stars
75.2K
+149 today
Forks
4.7K
Watchers
197
Open issues
935
Open PRs
954
Contributors
~131
Commits
1.5K
Branches
142

RustApache-2.0Created Jan 22, 2026Last push todayLatest release v0.44.2+979 stars this week+1.3K this month

Star history

since Feb 1, 2026
020K40K60KFeb 2026Apr 2026Jun 2026Aug 2026
75.2K stars as of Aug 7, 2026, tracked back to Feb 1, 2026. Historical curve reconstructed from public GitHub event archives, calibrated to the current total.

Contribution activity

commits per day, last 52 weeks
AugSepOctNovDecJanFebMarAprMayJunJulAugMonWedFri2025-08-09: 0 commits2025-08-10: 0 commits2025-08-11: 0 commits2025-08-12: 0 commits2025-08-13: 0 commits2025-08-14: 0 commits2025-08-15: 0 commits2025-08-16: 0 commits2025-08-17: 0 commits2025-08-18: 0 commits2025-08-19: 0 commits2025-08-20: 0 commits2025-08-21: 0 commits2025-08-22: 0 commits2025-08-23: 0 commits2025-08-24: 0 commits2025-08-25: 0 commits2025-08-26: 0 commits2025-08-27: 0 commits2025-08-28: 0 commits2025-08-29: 0 commits2025-08-30: 0 commits2025-08-31: 0 commits2025-09-01: 0 commits2025-09-02: 0 commits2025-09-03: 0 commits2025-09-04: 0 commits2025-09-05: 0 commits2025-09-06: 0 commits2025-09-07: 0 commits2025-09-08: 0 commits2025-09-09: 0 commits2025-09-10: 0 commits2025-09-11: 0 commits2025-09-12: 0 commits2025-09-13: 0 commits2025-09-14: 0 commits2025-09-15: 0 commits2025-09-16: 0 commits2025-09-17: 0 commits2025-09-18: 0 commits2025-09-19: 0 commits2025-09-20: 0 commits2025-09-21: 0 commits2025-09-22: 0 commits2025-09-23: 0 commits2025-09-24: 0 commits2025-09-25: 0 commits2025-09-26: 0 commits2025-09-27: 0 commits2025-09-28: 0 commits2025-09-29: 0 commits2025-09-30: 0 commits2025-10-01: 0 commits2025-10-02: 0 commits2025-10-03: 0 commits2025-10-04: 0 commits2025-10-05: 0 commits2025-10-06: 0 commits2025-10-07: 0 commits2025-10-08: 0 commits2025-10-09: 0 commits2025-10-10: 0 commits2025-10-11: 0 commits2025-10-12: 0 commits2025-10-13: 0 commits2025-10-14: 0 commits2025-10-15: 0 commits2025-10-16: 0 commits2025-10-17: 0 commits2025-10-18: 0 commits2025-10-19: 0 commits2025-10-20: 0 commits2025-10-21: 0 commits2025-10-22: 0 commits2025-10-23: 0 commits2025-10-24: 0 commits2025-10-25: 0 commits2025-10-26: 0 commits2025-10-27: 0 commits2025-10-28: 0 commits2025-10-29: 0 commits2025-10-30: 0 commits2025-10-31: 0 commits2025-11-01: 0 commits2025-11-02: 0 commits2025-11-03: 0 commits2025-11-04: 0 commits2025-11-05: 0 commits2025-11-06: 0 commits2025-11-07: 0 commits2025-11-09: 0 commits2025-11-10: 0 commits2025-11-11: 0 commits2025-11-12: 0 commits2025-11-13: 0 commits2025-11-14: 0 commits2025-11-15: 0 commits2025-11-16: 0 commits2025-11-17: 0 commits2025-11-18: 0 commits2025-11-19: 0 commits2025-11-20: 0 commits2025-11-21: 0 commits2025-11-22: 0 commits2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 5 commits2026-01-23: 14 commits2026-01-24: 2 commits2026-01-25: 0 commits2026-01-26: 1 commit2026-01-27: 0 commits2026-01-28: 11 commits2026-01-29: 13 commits2026-01-30: 12 commits2026-01-31: 6 commits2026-02-01: 8 commits2026-02-02: 27 commits2026-02-03: 9 commits2026-02-04: 3 commits2026-02-05: 1 commit2026-02-06: 4 commits2026-02-07: 6 commits2026-02-08: 1 commit2026-02-09: 1 commit2026-02-10: 1 commit2026-02-11: 0 commits2026-02-12: 17 commits2026-02-13: 8 commits2026-02-14: 7 commits2026-02-15: 11 commits2026-02-16: 8 commits2026-02-17: 6 commits2026-02-18: 7 commits2026-02-19: 4 commits2026-02-20: 3 commits2026-02-21: 1 commit2026-02-22: 3 commits2026-02-23: 1 commit2026-02-24: 0 commits2026-02-25: 0 commits2026-02-26: 0 commits2026-02-27: 1 commit2026-02-28: 7 commits2026-03-01: 2 commits2026-03-02: 1 commit2026-03-03: 1 commit2026-03-04: 4 commits2026-03-05: 22 commits2026-03-06: 31 commits2026-03-07: 1 commit2026-03-08: 1 commit2026-03-09: 1 commit2026-03-10: 13 commits2026-03-11: 15 commits2026-03-12: 16 commits2026-03-13: 16 commits2026-03-14: 2 commits2026-03-15: 0 commits2026-03-16: 7 commits2026-03-17: 1 commit2026-03-18: 13 commits2026-03-19: 12 commits2026-03-20: 5 commits2026-03-21: 7 commits2026-03-22: 2 commits2026-03-23: 4 commits2026-03-24: 6 commits2026-03-25: 15 commits2026-03-26: 7 commits2026-03-27: 11 commits2026-03-28: 10 commits2026-03-29: 7 commits2026-03-30: 16 commits2026-03-31: 5 commits2026-04-01: 2 commits2026-04-02: 11 commits2026-04-03: 17 commits2026-04-04: 12 commits2026-04-05: 7 commits2026-04-06: 8 commits2026-04-07: 2 commits2026-04-08: 4 commits2026-04-09: 4 commits2026-04-10: 14 commits2026-04-11: 6 commits2026-04-12: 14 commits2026-04-13: 4 commits2026-04-14: 5 commits2026-04-15: 3 commits2026-04-16: 5 commits2026-04-17: 4 commits2026-04-18: 8 commits2026-04-19: 7 commits2026-04-20: 3 commits2026-04-21: 2 commits2026-04-22: 4 commits2026-04-23: 5 commits2026-04-24: 5 commits2026-04-25: 7 commits2026-04-26: 5 commits2026-04-27: 2 commits2026-04-28: 7 commits2026-04-29: 9 commits2026-04-30: 2 commits2026-05-01: 4 commits2026-05-02: 0 commits2026-05-03: 1 commit2026-05-04: 3 commits2026-05-05: 6 commits2026-05-06: 9 commits2026-05-07: 3 commits2026-05-08: 7 commits2026-05-09: 1 commit2026-05-10: 3 commits2026-05-11: 1 commit2026-05-12: 2 commits2026-05-13: 5 commits2026-05-14: 2 commits2026-05-15: 3 commits2026-05-16: 4 commits2026-05-17: 5 commits2026-05-18: 2 commits2026-05-19: 0 commits2026-05-20: 6 commits2026-05-21: 8 commits2026-05-22: 4 commits2026-05-23: 5 commits2026-05-24: 2 commits2026-05-25: 19 commits2026-05-26: 5 commits2026-05-27: 3 commits2026-05-28: 3 commits2026-05-29: 6 commits2026-05-30: 2 commits2026-05-31: 2 commits2026-06-01: 1 commit2026-06-02: 0 commits2026-06-03: 17 commits2026-06-04: 2 commits2026-06-05: 5 commits2026-06-06: 4 commits2026-06-07: 2 commits2026-06-08: 3 commits2026-06-09: 2 commits2026-06-10: 0 commits2026-06-11: 4 commits2026-06-12: 4 commits2026-06-13: 1 commit2026-06-14: 4 commits2026-06-15: 1 commit2026-06-16: 1 commit2026-06-17: 3 commits2026-06-18: 11 commits2026-06-19: 1 commit2026-06-20: 1 commit2026-06-21: 1 commit2026-06-22: 1 commit2026-06-23: 6 commits2026-06-24: 7 commits2026-06-25: 2 commits2026-06-26: 13 commits2026-06-27: 3 commits2026-06-28: 2 commits2026-06-29: 6 commits2026-06-30: 10 commits2026-07-01: 20 commits2026-07-02: 7 commits2026-07-03: 21 commits2026-07-04: 2 commits2026-07-05: 3 commits2026-07-06: 6 commits2026-07-07: 0 commits2026-07-08: 1 commit2026-07-09: 2 commits2026-07-10: 0 commits2026-07-11: 0 commits2026-07-12: 0 commits2026-07-13: 0 commits2026-07-14: 0 commits2026-07-15: 0 commits2026-07-16: 1 commit2026-07-17: 0 commits2026-07-18: 2 commits2026-07-19: 0 commits2026-07-20: 6 commits2026-07-21: 2 commits2026-07-22: 22 commits2026-07-23: 12 commits2026-07-24: 3 commits2026-07-25: 2 commits2026-07-26: 5 commits2026-07-27: 4 commits2026-07-28: 7 commits2026-07-29: 1 commit2026-07-30: 4 commits2026-07-31: 0 commits2026-08-01: 2 commits2026-08-02: 0 commits2026-08-03: 0 commits2026-08-04: 1 commit2026-08-05: 10 commits2026-08-06: 0 commits2026-08-07: 0 commits2026-08-08: 0 commits
1,041 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Landmark project

    75,162 stars

  • Very active

    1,041 commits in 52 weeks

  • Community-driven

    ~131 contributors

  • Permissive license

    Apache-2.0

  • Repeat trending

    25 trending appearances

  • Top 10% tracked

    Rank 95 of 1058

What rtk does

RTK (Reduce Token Konduktor) is a lightweight, single-binary CLI tool written in Rust that sits between your development tools and LLM APIs. Its primary purpose is to intercept and optimize the prompts sent to AI models, significantly reducing token usage by 60-90% without compromising the quality of the generated code. It achieves this by employing smart caching, context pruning, and intelligent prompt rewriting for common dev tasks. As a zero-dependency tool, it's designed for speed and easy integration into existing terminal workflows, saving developers substantial costs on API usage.

Developers and teams using CLI-based AI assistants who want to optimize token usage and reduce API costs. Requires basic CLI setup.

  • Token optimization: Employs context pruning and prompt rewriting to reduce token usage by up to 90%.
  • Zero dependencies: Distributed as a single, fast Rust binary that requires no complex setup.
  • CLI proxy architecture: Transparently intercepts requests from dev tools to LLM providers.
  • Smart caching: Caches common requests and context to prevent redundant API calls.
  • Seamless integration: Works alongside existing CLI tools and AI assistants.

Where teams use it

Cost Reduction

Independent developers use it to drastically cut their monthly API bills when using tools like Claude Code or Copilot CLI.

Faster Responses

Users experience lower latency as smaller prompts are processed faster by the LLM providers.

Automated Workflows

Integrated into CI/CD pipelines to optimize automated AI code reviews or test generation.

Context Management

Automatically filtering out irrelevant boilerplate code before sending context to the model.

Getting started: Download the binary and configure it as a proxy for your AI CLI tools.

README

develop branch

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, <10ms overhead.

What RTK Does

RTK intercepts shell commands and compresses their output before your agent reads it.

Operation What RTK does to the output
ls / tree Tree format with file counts instead of one line per entry
cat / read Smart file reading: signatures and structure over full bodies
grep / rg Truncates long lines, groups matches by file
git status Compact stat format, grouped by state
git diff Reduced context, headers stripped
git log Hash, author and subject only
git add/commit/push Confirmation line instead of full progress output
cargo test / npm test Failures only, passing tests collapsed to a count
ruff check Grouped by rule and file
pytest Failures only, traceback trimmed
go test NDJSON parsed, failures only
docker ps Essential fields only

How Savings Work

RTK cuts up to 90% of the bash output your agent reads. That is what RTK measures, and it is not the same as cutting your bill by 90%.

Bash output is one contributor to input tokens, alongside your prompt, the system prompt and conversation history. Input tokens are in turn only part of the bill, which also counts output tokens. The reduction dilutes at every step.

The token counts RTK reports are estimated as bytes / 4 — RTK ships no tokenizer, so the percentages are reliable but the absolute token numbers are approximate.

Full explanation: How RTK Savings Work

Installation

Homebrew (recommended)

brew install 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\<you>\.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 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

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 only)
rtk pytest                      # Python tests (-90%)
rtk go test                     # Go tests (NDJSON, -90%)
rtk cargo test                  # Cargo tests (-90%)
rtk rake test                   # Ruby minitest (-90%)
rtk rspec                       # RSpec tests (JSON, -60%+)
rtk err <cmd>                   # Filter errors only from any command
rtk test <cmd>                  # Generic test wrapper - failures only (-90%)

Build & Lint

rtk lint                        # ESLint grouped by rule/file
rtk lint biome                  # Supports other linters
rtk tsc                         # TypeScript errors grouped by file
rtk next build                  # Next.js build compact
rtk prettier --check .          # Files needing formatting
rtk cargo build                 # Cargo build (-80%)
rtk cargo clippy                # Cargo clippy (-80%)
rtk ruff check                  # Python linting (JSON, -80%)
rtk golangci-lint run           # Go linting (JSON, -85%)
rtk rubocop                     # Ruby linting (JSON, -60%+)
rtk sbt test                    # ScalaTest output (-90%)
rtk sbt compile                 # Compilation errors only (-75%)
rtk sbt run                     # Strip SBT preamble noise

Package Managers

rtk pnpm list                   # Compact dependency tree
rtk uv run pytest               # Preserve uv env, keep program output
rtk pip list                    # Python packages (auto-detect uv)
rtk pip outdated                # Outdated packages
rtk bundle install              # Ruby gems (strip Using lines)
rtk prisma generate             # Schema generation (no ASCII art)

AWS

rtk aws sts get-caller-identity # One-line identity
rtk aws ec2 describe-instances  # Compact instance list
rtk aws lambda list-functions   # Name/runtime/memory (strips secrets)
rtk aws logs get-log-events     # Timestamped messages only
rtk aws cloudformation describe-stack-events  # Failures first
rtk aws dynamodb scan           # Unwraps type annotations
rtk aws iam list-roles          # Strips policy documents
rtk aws s3 ls                   # Truncated with tee recovery

Containers

rtk docker ps                   # Compact container list
rtk docker images               # Compact image list
rtk docker logs <container>     # Deduplicated logs
rtk docker compose ps           # Compose services
rtk kubectl pods                # Compact pod list
rtk kubectl logs <pod>          # Deduplicated logs
rtk kubectl services            # Compact service list
rtk oc get pods                 # OpenShift pod summary
rtk oc get services             # OpenShift service list
rtk oc logs <pod>               # Deduplicated logs

Infrastructure as Code

rtk pulumi preview              # Strip header/URL/duration noise
rtk pulumi up                   # Compact apply output
rtk pulumi destroy              # Compact destroy output
rtk pulumi refresh              # Drift summary
rtk pulumi stack                # Stack metadata (strips owner/timestamps)

Data & Analytics

rtk json config.json            # Structure without values
rtk deps                        # Dependencies summary
rtk env -f AWS                  # Filtered env vars
rtk log app.log                 # Deduplicated logs
rtk curl <url>                  # Truncate + save full output
rtk wget <url>                  # Download, strip progress bars
rtk summary <long command>      # Heuristic summary
rtk proxy <command>             # Raw passthrough + tracking

Token Savings Analytics

rtk gain                        # Summary stats
rtk gain --graph                # ASCII graph (last 30 days)
rtk gain --history              # Recent command history
rtk gain --daily                # Day-by-day breakdown
rtk gain --all --format json    # JSON export for dashboards

rtk discover                    # Find missed savings opportunities
rtk discover --all --since 7    # All projects, last 7 days

rtk session                     # Show RTK adoption across recent sessions

Global Flags

-u, --ultra-compact    # ASCII icons, inline format (further output reduction)
-v, --verbose          # Increase verbosity (-v, -vv, -vvv)

Examples

Directory listing:

# ls -la (45 lines)                     # rtk ls (12 lines)
drwxr-xr-x  15 user staff 480 ...       my-project/
-rw-r--r--   1 user staff 1234 ...       +-- src/ (8 files)
...                                      |   +-- main.rs
                                         +-- Cargo.toml

Git operations:

# git push (15 lines)                    # rtk git push (1 line)
Enumerating objects: 5, done.             ok main
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
...

Test output:

# cargo test (200+ lines on failure)     # rtk test cargo test (~20 lines)
running 15 tests                          FAILED: 2/15 tests
test utils::test_parse ... ok               test_edge_case: assertion failed
test utils::test_format ... ok              test_overflow: panic at utils.rs:18
...

Auto-Rewrite Hook

The most effective way to use rtk. The hook transparently intercepts Bash commands and rewrites them to rtk equivalents before execution.

Result: 100% rtk adoption across all conversations and subagents, with no per-command context overhead.

Scope note: this only applies to Bash tool calls. Claude Code built-in tools such as Read, Grep, and Glob bypass the hook, so use shell commands or explicit rtk commands when you want RTK filtering there.

Setup

rtk init -g                 # Install hook + RTK.md (recommended)
rtk init -g --opencode      # OpenCode plugin (instead of Claude Code)
rtk init -g --auto-patch    # Non-interactive (CI/CD)
rtk init -g --hook-only     # Hook only, no RTK.md
rtk init --show             # Verify installation

After install, restart Claude Code.

Windows

RTK works fully on native Windows. Since v0.37.2 the auto-rewrite hook runs as a native binary command (rtk hook claude) — no Unix shell, bash, or jq required — so commands are rewritten transparently on Command Prompt, PowerShell, and Windows Terminal, just like on Linux and macOS.

Native Windows

# 1. Download and extract rtk-x86_64-pc-windows-msvc.zip from releases
# 2. Add rtk.exe to your PATH (e.g. C:\Users\<you>\.local\bin)
# 3. Initialize — installs the native binary hook
rtk init -g

Upgrading from an older install? If you set RTK up before v0.37.2 you may still have the legacy rtk-rewrite.sh shell hook (which does need a Unix shell). Re-run rtk init -g to migrate to the native binary hook.

Prerequisites: some filters shell out to ripgrep (rg). Install it and keep it on your PATH (e.g. winget install BurntSushi.ripgrep.MSVC) to avoid Binary 'rg' not found on PATH warnings.

Important: Do not double-click rtk.exe — it is a CLI tool that prints usage and exits immediately. Always run it from a terminal (Command Prompt, PowerShell, or Windows Terminal).

WSL

WSL also works and behaves exactly like Linux:

# Inside WSL
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
rtk init -g
Feature Native Windows WSL
Filters (cargo, git, etc.) Full Full
Auto-rewrite hook Yes (native binary) Yes
rtk init -g Hook mode Hook mode
rtk gain / analytics Full Full

Supported AI Tools

RTK supports 16 AI coding tools. Each integration rewrites shell commands to rtk equivalents, reducing the bash output the agent reads where the agent supports command interception.

Tool Install Method
Claude Code rtk init -g PreToolUse hook (native binary)
GitHub Copilot (VS Code) rtk init -g --copilot PreToolUse hook — transparent rewrite
GitHub Copilot CLI rtk init -g --copilot PreToolUse deny-with-suggestion (CLI limitation)
Cursor rtk init -g --agent cursor preToolUse hook (hooks.json)
Gemini CLI rtk init -g --gemini BeforeTool hook
Codex rtk init -g --codex AGENTS.md + RTK.md instructions
Windsurf rtk init -g --agent windsurf .windsurfrules (project-scoped)
Cline / Roo Code rtk init --agent cline .clinerules (project-scoped)
OpenCode rtk init -g --opencode Plugin TS (tool.execute.before)
OpenClaw openclaw plugins install ./openclaw Plugin TS (before_tool_call)
Pi rtk init -g --agent pi (global) TypeScript extension (tool_call)
Hermes rtk init --agent hermes Python plugin adapter (terminal command mutation via rtk rewrite)
Mistral Vibe rtk init -g --agent vibe pre_tool hook (hooks.toml)
Kilo Code rtk init --agent kilocode .kilocode/rules/rtk-rules.md (project-scoped)
Google Antigravity rtk init --agent antigravity .agents/rules/antigravity-rtk-rules.md (project-scoped)
Kimi AI rtk init --agent kimi AGENTS.md (project-scoped)
Factory Droid rtk init -g --agent droid (or per-project) PreToolUse hook in ~/.factory/hooks.json (matcher Execute)

For per-agent setup details, override controls, and graceful degradation, see the Supported Agents guide. The Hermes plugin source and tests live in hooks/hermes/; installed Hermes runtime files still live under ~/.hermes/plugins/rtk-rewrite/.

Configuration

~/.config/rtk/config.toml (macOS: ~/Library/Application Support/rtk/config.toml):

[hooks]
exclude_commands = ["curl", "playwright"]  # skip rewrite for these

[tee]
enabled = true          # save raw output on failure (default: true)
mode = "failures"       # "failures", "always", or "never"

When a command fails, RTK saves the full unfiltered output so the LLM can read it without re-executing:

FAILED: 2/15 tests
[full output: ~/.local/share/rtk/tee/1707753600_cargo_test.log]

For the full config reference (all sections, env vars, per-project filters), see the Configuration guide.

Uninstall

rtk init -g --uninstall     # Remove hook, RTK.md, settings.json entry
cargo uninstall rtk          # Remove binary
brew uninstall rtk           # If installed via Homebrew

Documentation

Privacy & Telemetry

RTK can collect anonymous, aggregate usage metrics once per day. Telemetry is disabled by default and requires explicit opt-in consent (GDPR Art. 6, 7) during rtk init or via rtk telemetry enable. This data helps us build a better product: identifying which commands need filters, which filters need improvement, and how much value RTK delivers. For the full list of fields, data handling, and contributor guidelines, see docs/TELEMETRY.md.

What is collected and why:

Category Data Why
Identity Salted device hash (SHA-256, not reversible) Count unique installations without tracking individuals
Environment RTK version, OS, architecture, install method Know which platforms to support and test
Usage volume Command count (24h), total commands, estimated tokens saved (24h/30d/total) Measure adoption and value delivered
Quality Top 5 passthrough commands (0% reduction), parse failure count, commands with <30% reduction Identify missing filters and weak ones to improve
Ecosystem Command category distribution (e.g. git 45%, cargo 20%, js 15%) Prioritize filter development for popular ecosystems
Retention Days since first use, active days in last 30 Understand engagement and detect churn
Adoption AI agent hook type (claude/gemini/codex), custom TOML filter count Track integration coverage and DSL adoption
Configuration Whether config.toml exists, number of excluded commands, project count Understand user maturity and customization patterns
Features Usage counts for meta-commands (gain, discover, proxy, verify) Know which RTK features are valued vs unused
Economics Estimated USD value, derived from the estimated tokens saved and a fixed internal constant Quantify the value RTK provides to users

All data is aggregate counts or anonymized command names (first 3 words, no arguments). Top commands report only tool names (e.g. "git", "cargo"), never full command lines.

What is NOT collected: source code, file paths, command arguments, secrets, environment variables, personal data, or repository contents.

Manage telemetry:

rtk telemetry status     # Check current consent state
rtk telemetry enable     # Give consent (interactive prompt)
rtk telemetry disable    # Withdraw consent — stops all collection immediately
rtk telemetry forget     # Withdraw consent + delete all local data + request server-side erasure

Override via environment:

export RTK_TELEMETRY_DISABLED=1   # Blocks telemetry regardless of consent

Star History

Star History Chart

StarMapper

StarMapper

Core team

Contributing

Contributions welcome! Please open an issue or PR on GitHub.

Join the community on Discord.

License

Apache License 2.0 - see LICENSE for details.

Disclaimer

See DISCLAIMER.md.

View on GitHub

Recent activity

commits and pull requests

Recent open issues

view all

Discussions

all 67

Releases and announcements

272 total
  1. dev-0.45.0-rc.351dev-0.45.0-rc.351Aug 6, 2026pre-release66 downloads
  2. dev-0.45.0-rc.350dev-0.45.0-rc.350Aug 3, 2026pre-release716 downloads
  3. dev-0.44.3-rc.349dev-0.44.3-rc.349Aug 2, 2026pre-release79 downloads
  4. v0.44.2v0.44.2Aug 1, 2026105.6K downloads

    ## [0.44.2](https://github.com/rtk-ai/rtk/compare/v0.44.1...v0.44.2) (2026-08-01) ### Bug Fixes * **security:** store history db, tee logs and audit log owner-only ([57b7900](https://github.com/rtk-ai/rtk/commit/57b79008d492bf6e070f7a56e3e25a699c4227a6)) * **security:** tighten data dirs that already exist ([18925c2](https://github.com/rtk-ai/rtk/commit/18925c28346e4f76396ba3bb2fccdda96b14e3ec)) * **tee:** quote recovery hint paths with spaces ([8a24ce2](https://github.com/rtk-ai/rtk/commit/8a24ce2e2828117f69ffc31134ed12f36d33fac4))

  5. dev-0.44.2-rc.346dev-0.44.2-rc.346Aug 1, 2026pre-release60 downloads

Code frequency

additions and deletions
+50.3K-50.3KWeek of 2026-01-18: +10,179 linesWeek of 2026-01-18: -3,424 linesWeek of 2026-01-25: +12,464 linesWeek of 2026-01-25: -749 linesWeek of 2026-02-01: +14,964 linesWeek of 2026-02-01: -4,772 linesWeek of 2026-02-08: +8,927 linesWeek of 2026-02-08: -458 linesWeek of 2026-02-15: +9,258 linesWeek of 2026-02-15: -409 linesWeek of 2026-02-22: +1,207 linesWeek of 2026-02-22: -236 linesWeek of 2026-03-01: +11,609 linesWeek of 2026-03-01: -1,950 linesWeek of 2026-03-08: +23,717 linesWeek of 2026-03-08: -2,450 linesWeek of 2026-03-15: +13,971 linesWeek of 2026-03-15: -1,493 linesWeek of 2026-03-22: +50,286 linesWeek of 2026-03-22: -45,579 linesWeek of 2026-03-29: +20,006 linesWeek of 2026-03-29: -14,546 linesWeek of 2026-04-05: +8,893 linesWeek of 2026-04-05: -7,882 linesWeek of 2026-04-12: +3,499 linesWeek of 2026-04-12: -1,414 linesWeek of 2026-04-19: +3,342 linesWeek of 2026-04-19: -784 linesWeek of 2026-04-26: +3,594 linesWeek of 2026-04-26: -663 linesWeek of 2026-05-03: +5,981 linesWeek of 2026-05-03: -1,645 linesWeek of 2026-05-10: +2,035 linesWeek of 2026-05-10: -877 linesWeek of 2026-05-17: +3,642 linesWeek of 2026-05-17: -1,102 linesWeek of 2026-05-24: +2,852 linesWeek of 2026-05-24: -481 linesWeek of 2026-05-31: +4,572 linesWeek of 2026-05-31: -803 linesWeek of 2026-06-07: +1,248 linesWeek of 2026-06-07: -509 linesWeek of 2026-06-14: +1,394 linesWeek of 2026-06-14: -387 linesWeek of 2026-06-21: +4,215 linesWeek of 2026-06-21: -2,563 linesWeek of 2026-06-28: +2,923 linesWeek of 2026-06-28: -971 linesWeek of 2026-07-05: +1,121 linesWeek of 2026-07-05: -291 linesWeek of 2026-07-12: +268 linesWeek of 2026-07-12: -87 linesWeek of 2026-07-19: +2,495 linesWeek of 2026-07-19: -1,755 linesWeek of 2026-07-26: +859 linesWeek of 2026-07-26: -681 linesJan 18, 2026Jul 26, 2026
+229.5K lines added, -99K removed over the last year.

Commits per week

last 52 weeks
700Week of 2025-08-09: 0 commitsWeek of 2025-08-16: 0 commitsWeek of 2025-08-23: 0 commitsWeek of 2025-08-30: 0 commitsWeek of 2025-09-06: 0 commitsWeek of 2025-09-13: 0 commitsWeek of 2025-09-20: 0 commitsWeek of 2025-09-27: 0 commitsWeek of 2025-10-04: 0 commitsWeek of 2025-10-11: 0 commitsWeek of 2025-10-18: 0 commitsWeek of 2025-10-25: 0 commitsWeek of 2025-11-01: 0 commitsWeek of 2025-11-09: 0 commitsWeek of 2025-11-16: 0 commitsWeek of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 21 commitsWeek of 2026-01-25: 43 commitsWeek of 2026-02-01: 58 commitsWeek of 2026-02-08: 35 commitsWeek of 2026-02-15: 40 commitsWeek of 2026-02-22: 12 commitsWeek of 2026-03-01: 62 commitsWeek of 2026-03-08: 64 commitsWeek of 2026-03-15: 45 commitsWeek of 2026-03-22: 55 commitsWeek of 2026-03-29: 70 commitsWeek of 2026-04-05: 45 commitsWeek of 2026-04-12: 43 commitsWeek of 2026-04-19: 33 commitsWeek of 2026-04-26: 29 commitsWeek of 2026-05-03: 30 commitsWeek of 2026-05-10: 20 commitsWeek of 2026-05-17: 30 commitsWeek of 2026-05-24: 40 commitsWeek of 2026-05-31: 31 commitsWeek of 2026-06-07: 16 commitsWeek of 2026-06-14: 22 commitsWeek of 2026-06-21: 33 commitsWeek of 2026-06-28: 68 commitsWeek of 2026-07-05: 12 commitsWeek of 2026-07-12: 3 commitsWeek of 2026-07-19: 47 commitsWeek of 2026-07-26: 23 commitsWeek of 2026-08-02: 11 commitsAug 9, 2025Aug 2, 2026
1K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 8 commitsSun 1:00 — 6 commitsSun 2:00 — 5 commitsSun 3:00 — 0 commitsSun 4:00 — 0 commitsSun 5:00 — 0 commitsSun 6:00 — 0 commitsSun 7:00 — 0 commitsSun 8:00 — 0 commitsSun 9:00 — 2 commitsSun 10:00 — 3 commitsSun 11:00 — 10 commitsSun 12:00 — 10 commitsSun 13:00 — 3 commitsSun 14:00 — 14 commitsSun 15:00 — 9 commitsSun 16:00 — 4 commitsSun 17:00 — 4 commitsSun 18:00 — 4 commitsSun 19:00 — 3 commitsSun 20:00 — 3 commitsSun 21:00 — 5 commitsSun 22:00 — 2 commitsSun 23:00 — 3 commitsMon 0:00 — 7 commitsMon 1:00 — 3 commitsMon 2:00 — 1 commitsMon 3:00 — 0 commitsMon 4:00 — 0 commitsMon 5:00 — 0 commitsMon 6:00 — 1 commitsMon 7:00 — 2 commitsMon 8:00 — 1 commitsMon 9:00 — 9 commitsMon 10:00 — 9 commitsMon 11:00 — 9 commitsMon 12:00 — 10 commitsMon 13:00 — 6 commitsMon 14:00 — 10 commitsMon 15:00 — 7 commitsMon 16:00 — 4 commitsMon 17:00 — 8 commitsMon 18:00 — 12 commitsMon 19:00 — 10 commitsMon 20:00 — 13 commitsMon 21:00 — 7 commitsMon 22:00 — 5 commitsMon 23:00 — 3 commitsTue 0:00 — 3 commitsTue 1:00 — 1 commitsTue 2:00 — 3 commitsTue 3:00 — 2 commitsTue 4:00 — 0 commitsTue 5:00 — 0 commitsTue 6:00 — 1 commitsTue 7:00 — 3 commitsTue 8:00 — 9 commitsTue 9:00 — 2 commitsTue 10:00 — 10 commitsTue 11:00 — 12 commitsTue 12:00 — 1 commitsTue 13:00 — 3 commitsTue 14:00 — 4 commitsTue 15:00 — 9 commitsTue 16:00 — 6 commitsTue 17:00 — 3 commitsTue 18:00 — 5 commitsTue 19:00 — 3 commitsTue 20:00 — 8 commitsTue 21:00 — 6 commitsTue 22:00 — 5 commitsTue 23:00 — 2 commitsWed 0:00 — 0 commitsWed 1:00 — 0 commitsWed 2:00 — 1 commitsWed 3:00 — 0 commitsWed 4:00 — 6 commitsWed 5:00 — 0 commitsWed 6:00 — 2 commitsWed 7:00 — 0 commitsWed 8:00 — 3 commitsWed 9:00 — 6 commitsWed 10:00 — 6 commitsWed 11:00 — 12 commitsWed 12:00 — 13 commitsWed 13:00 — 8 commitsWed 14:00 — 13 commitsWed 15:00 — 19 commitsWed 16:00 — 12 commitsWed 17:00 — 23 commitsWed 18:00 — 25 commitsWed 19:00 — 13 commitsWed 20:00 — 11 commitsWed 21:00 — 12 commitsWed 22:00 — 5 commitsWed 23:00 — 4 commitsThu 0:00 — 6 commitsThu 1:00 — 5 commitsThu 2:00 — 0 commitsThu 3:00 — 3 commitsThu 4:00 — 2 commitsThu 5:00 — 1 commitsThu 6:00 — 2 commitsThu 7:00 — 0 commitsThu 8:00 — 1 commitsThu 9:00 — 10 commitsThu 10:00 — 5 commitsThu 11:00 — 16 commitsThu 12:00 — 9 commitsThu 13:00 — 7 commitsThu 14:00 — 9 commitsThu 15:00 — 16 commitsThu 16:00 — 13 commitsThu 17:00 — 17 commitsThu 18:00 — 10 commitsThu 19:00 — 5 commitsThu 20:00 — 17 commitsThu 21:00 — 13 commitsThu 22:00 — 13 commitsThu 23:00 — 6 commitsFri 0:00 — 10 commitsFri 1:00 — 2 commitsFri 2:00 — 1 commitsFri 3:00 — 1 commitsFri 4:00 — 2 commitsFri 5:00 — 2 commitsFri 6:00 — 1 commitsFri 7:00 — 5 commitsFri 8:00 — 0 commitsFri 9:00 — 13 commitsFri 10:00 — 16 commitsFri 11:00 — 19 commitsFri 12:00 — 15 commitsFri 13:00 — 22 commitsFri 14:00 — 23 commitsFri 15:00 — 34 commitsFri 16:00 — 12 commitsFri 17:00 — 8 commitsFri 18:00 — 4 commitsFri 19:00 — 20 commitsFri 20:00 — 3 commitsFri 21:00 — 2 commitsFri 22:00 — 0 commitsFri 23:00 — 3 commitsSat 0:00 — 4 commitsSat 1:00 — 10 commitsSat 2:00 — 1 commitsSat 3:00 — 0 commitsSat 4:00 — 0 commitsSat 5:00 — 0 commitsSat 6:00 — 0 commitsSat 7:00 — 0 commitsSat 8:00 — 0 commitsSat 9:00 — 3 commitsSat 10:00 — 8 commitsSat 11:00 — 7 commitsSat 12:00 — 3 commitsSat 13:00 — 5 commitsSat 14:00 — 6 commitsSat 15:00 — 16 commitsSat 16:00 — 3 commitsSat 17:00 — 6 commitsSat 18:00 — 10 commitsSat 19:00 — 6 commitsSat 20:00 — 3 commitsSat 21:00 — 3 commitsSat 22:00 — 9 commitsSat 23:00 — 8 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.
DateListRankStars gained
Jul 23, 2026daily#23+4
Jun 17, 2026daily#20+13
May 20, 2026daily#17+46
May 19, 2026daily#22+34
May 8, 2026daily#13+69
May 7, 2026daily#15+60
May 5, 2026daily#20+60
May 3, 2026daily#22+123
May 2, 2026daily#19+122
May 1, 2026daily#25+60
Apr 27, 2026daily#18+94
Apr 26, 2026daily#18+165
Apr 25, 2026daily#10+226
Apr 24, 2026daily#14+117
Apr 23, 2026daily#17+105
  • public-apis/public-apis

    A collective list of free APIs

    454.9K stars · Python

  • affaan-m/ECC

    The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

    238.5K stars · JavaScript

  • affaan-m/ECC

    The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

    234.7K stars · JavaScript

  • NousResearch/hermes-agent

    The agent that grows with you

    227K stars · Python

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    195K stars · Rust

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    194.9K stars · Rust