Repository iconcurepo.dev
Blog
rtk preview

rtk-ai / rtk

agentic-codingai-codinganthropicclaude-code

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

87.6k Stars
visibility214 Watchers
fork_right5.6k Forks
Rust
historyUpdated recently

description README.md

RTK — Rust Token Killer. Fewer tokens, more possibilities.

The cost reduction engine for AI coding agents.
Install it and forget it, then go as far as you want with pipelines.

CI Release License: Apache-2.0 and BUSL-1.1 Discord Homebrew

Star History Rank GitHub Trending Repository of the Day

Starred by developers at Microsoft, Google, Amazon, Meta, Apple, NVIDIA, IBM, Tencent, ByteDance, Alibaba, Shopify, Datadog, SAP, Adobe, Intel, Samsung, Bosch, Cisco, JPMorgan Chase, Oracle, Netflix, Toyota, Salesforce, Siemens, Accenture, Uber, Spotify, and 1,100+ more companies

Install • Pipelines • Docs • Website • RTK Pro • Discord

English • Francais • 中文 • 日本語 • 한국어 • Espanol • Português


① Install & forget: up to 90% less command output. Test runs, diffs, logs and builds are compressed before your agent reads them. 100+ commands, under 25 ms per command, no config, nothing changes in how you work. rtk gain shows what you saved.

② Go further with pipelines, as far as you take it. Hand heavy reads to a cheaper model, compress more than bash, clean the API traffic without breaking the prompt cache. One agent-agnostic file: start from a built-in, install one someone shared, or write and share your own. The community built the bash compressor 85k developers starred. Now it is building pipelines: the best one listed today cuts total cost by 20.2% in its author's benchmark.

Agents across the whole company? RTK Pro is the control layer for every AI agent: one gateway for every AI call, costs, secrets and personal data, policies, team catalog, audit. Discover RTK Pro ↓

A real terminal session, sped up. rtk init -g registers the hook. claude -p is asked to run the test suite and answers that 3 of 281 tests fail, naming each one with its assertion. rtk gain then shows 2 commands, 3.4K tokens saved, 93.3%: rtk cargo test at 94.2% and rtk ls at 82.3%.




Install & forget

macOS, and Linux with Homebrew

brew install rtk

Windows, with winget

winget install rtk-ai.rtk

Linux, macOS, WSL, or Git Bash on Windows, with the install script

curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh

Then plug it into your agent

rtk init -g                      # Claude Code; every other agent: see "Works in your agent"

Restart your agent. That's it: when it runs git status, RTK runs rtk git status and the agent reads a 3-line summary instead of 40 lines. Nothing to learn, nothing to call, and upgrading RTK never changes this.

Another project named "rtk" exists on crates.io. Check you have this one: rtk gain must show the savings dashboard, not "command not found".

Cargo, pre-built binaries, native Windows, WSL and uninstall: Installation guide · per-agent setup and --dry-run: Quick Start


Measure it: rtk gain

Every command RTK touches is counted on your machine. One command shows what it saved, today and since you installed it.

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

What the numbers mean. The compressor reduces the command output your agent reads, which is one part of the input tokens, which are one part of the bill: a 90% cut in command output is not a 90% cut in cost. Token counts are estimated as bytes / 4, so the percentages are reliable and the absolute numbers are approximate.

After a week of data, rtk gain ends with one line about RTK Pro, at most once a day and only on a terminal. pro_hint = false under [display] in config.toml turns it off.

Full explanation: How RTK Savings Work · attribution, the live dashboard and export formats: Token Savings Analytics


Out of the box: the bash compressor

The part 85k developers starred. Built by 200+ contributors, written against real command output, and every filter has to cut at least 20% to ship.

cargo test on a 48-test crate: 71 lines of raw output on the left; on the right, the 11 lines the agent reads with rtk: the failing test's panic, assertion and location, the pass/fail summary, and an rtk recall line to get the full output back

OperationWhat the agent reads
cargo test / npm test / pytest / go testFailures only, with their assertion; passing tests collapsed to a count
git status / git diff / git logCompact status, reduced diff context, one line per commit
git add/commit/pushA confirmation line instead of progress output
ls / tree / grep / rgTrees with counts, matches grouped by file, long lines cut
ruff check / eslint / cargo clippyGrouped by rule and file
docker ps / kubectlEssential fields only

100+ commands across Git, GitHub CLI, Cargo/Rust, JavaScript (npm, pn