rtk-ai/rtk

★ 86,543⑂ 5,546

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

About rtk-ai/rtk

rtk-ai/rtk is an open-source project on GitHub, mainly written in Rust. CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies It currently holds 86,543 stars and 5,546 forks with 1,699 open issues, and was last pushed on 2026-11-14 (repository created 2026-01-22).

Project Overview

Git Homed tracks it on the AI Agent Skills Trending board and on the AI AI Agent Skills Trending list.

GitHub Repository Details

Repository rtk-ai/rtk · default branch develop · size 20015 KB · watchers 215 · source: GitHub REST API and repository README

README

https://github.com/rtk-ai/rtk/blob/HEAD/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.

https://github.com/rtk-ai/rtk/blob/HEAD/CI https://github.com/rtk-ai/rtk/blob/HEAD/Release https://github.com/rtk-ai/rtk/blob/HEAD/License: Apache-2.0 and BUSL-1.1 https://github.com/rtk-ai/rtk/blob/HEAD/Discord https://github.com/rtk-ai/rtk/blob/HEAD/Homebrew

https://github.com/rtk-ai/rtk/blob/HEAD/Star History Rank https://github.com/rtk-ai/rtk/blob/HEAD/GitHub Trending Repository of the Day

https://github.com/rtk-ai/rtk/blob/HEAD/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 ↓

https://github.com/rtk-ai/rtk/blob/HEAD/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 or WSL, 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.

https://github.com/rtk-ai/rtk/blob/HEAD/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

| Operation | What the agent reads | |-----------|----------------------| | cargo test / npm test / pytest / go test | Failures only, with their assertion; passing tests collapsed to a count | | git status / git diff / git log | Compact status, reduced diff context, one line per commit | | git add/commit/push | A confirmation line instead of progress output | | ls / tree / grep / rg | Trees with counts, matches grouped by file, long lines cut | | ruff check / eslint / cargo clippy | Grouped by rule and file | | docker ps / kubectl | Essential fields only |

100+ commands across Git, GitHub CLI, Cargo/Rust, JavaScript (npm, pnpm, vitest, jest, tsc, Next.js, Angular, Playwright, Prisma), Python (ruff, pytest, mypy, pip), Go (go test, golangci-lint), Ruby, .NET, JVM (Gradle, Maven), PHP, Docker, Kubernetes, AWS, Terraform, and the file/search builtins. Every command and its filter: What RTK Optimizes

Three promises

rtk bypass git log --oneline -20        # full git log, no truncation
rtk bypass npm install express          # raw npm output

The hook rewrites shell commands. Built-in tools such as Read, Grep and Glob pass through untouched out of the box; in Claude Code, a pipeline compresses them too (see Pipelines below).

Does RTK break the prompt cache? No: output is filtered once, before it enters the conversation. Details.


Want to go further? Pipelines.

Out of the box, RTK compresses command output and stops there. A pipeline is how you ask it for more: one small file that tells RTK what to do with what your agent reads and sends. No file means the compressor above and nothing else; a pipeline adds one thing at a time, and you can take it back out.

https://github.com/rtk-ai/rtk/blob/HEAD/Four things a pipeline turns on, one line each: less command output (on by default, up to 90% less); every tool compressed, not just the shell (Claude Code); big files read by a cheaper model you choose (Claude Code, your API key); clean API traffic through the optional proxy. Below: install a pipeline someone shared or share yours; the best one listed cuts total cost by 20.2% in its author's benchmark

What people turn on first

Each of these is a built-in pipeline, one line to turn on. rtk-ai.app/pipelines lists them next to the pipelines the community shares, each with what it saved and how that was measured. Installing one is a single command:

rtk pipeline add github:user/repo        # check and install a shared pipeline

A pipeline can rewrite commands and send content to the models it declares, so read its file before you install it. Written once, a pipeline works in every agent RTK supports, as far as that agent's hooks allow: Agent Coverage shows what runs where.

Start here: Pipelines · the built-ins, explained: Reference Pipelines · write and share your own: Writing a Pipeline, Pipeline Commands

RTK Proxy (optional)

The rtk-proxy daemon runs the same pipeline on your agent's provider-API traffic: it strips bytes no model ever needed without breaking the prompt cache, and carries the calls your pipeline routes to cheaper models on the credential your agent already sends, so they show up in rtk gain. rtk init -g offers to set it up; rtk claude starts it and launches Claude through it with no configuration at all.

rtk claude              # start the daemon if needed, then launch Claude through it
rtk llm-proxy status    # is it up
rtk gain                # savings, command filtering and proxy side by side

Separate binary, separate licence (BUSL-1.1), its own rtk-proxy- archive: rtk never links it. Not the same thing as rtk bypass, which runs one local command unfiltered.

Setup and subcommands: RTK Proxy · what it compresses: What the Proxy Compresses · settings and endpoints: Proxy Configuration


---


Agents across the whole company? Know what they cost, what they touch, and who ran what.

https://github.com/rtk-ai/rtk/blob/HEAD/RTK Pro: scale AI agents, stay in control. The control layer for every AI agent in your company. Gateway: every AI call in one place, whichever provider; spend by team, person and model; budgets that warn, then stop. Shield: secrets and personal data masked before any model sees them. Policies: risky commands stopped before they run. Team catalog: skills, MCP servers and pipelines, assigned per team and project. Audit: who did what, and whether it was allowed, every action on record. Runs on each developer's machine, never a secret value leaves it, the CLI stays free and open source.

RTK runs on each developer's machine. RTK Pro connects them into one control layer for the whole company:

Nothing changes for the developer. No secret value ever leaves the machine. The CLI stays free and open source.

| Just you? | Your team, or the whole company? | |---|---| | The Dev plan: guardrails and analytics for one developer. Your own dashboard of spend per project and per model, the Shield and policies on your machine, nothing to administer. | Teams, Business and Enterprise: the full control layer for every developer, with SSO and the audit log, scaled across the organisation, up to on-premise deployment and a custom SLA. | | Plans and what each includes → | See what it is worth for your team → · Talk to us → |


---


Works in your agent

RTK supports 18 AI coding tools. With a hook or plugin, rtk init installs it and compression is automatic. With a rules file, RTK asks the model to prefer rtk commands instead.

| Tool | Install | How | |------|---------|-----| | Claude Code | rtk init -g | hook | | GitHub Copilot (VS Code, CLI) | rtk init -g --copilot | hook | | Cursor | rtk init -g --agent cursor | hook | | Gemini CLI | rtk init -g --gemini | hook | | Codex | rtk init -g --codex | hook | | Mistral Vibe | rtk init -g --agent vibe | hook | | Factory Droid | rtk init -g --agent droid | hook | | Trae | rtk init --agent trae (or -g) | hook | | OpenCode (1.18.29+) | rtk init -g --opencode | plugin | | OpenClaw | openclaw plugins install ./openclaw | plugin | | Pi / Oh My Pi | rtk init -g --agent pi / --agent omp | plugin | | Hermes | rtk init --agent hermes | plugin | | Windsurf | rtk init -g --agent windsurf | rules file | | Cline / Roo Code | rtk init --agent cline | rules file | | Kilo Code | rtk init --agent kilocode | rules file | | Google Antigravity | rtk init --agent antigravity (or -g) | rules file | | Kimi AI | rtk init --agent kimi | rules file |

Per-agent setup, what each hook API allows, override controls: Supported Agents · Agent Coverage


Documentation

rtk-ai.app/docs is the full user guide.

| | | |---|---| | Installation | every install method, Windows, WSL, uninstall | | Quick Start | per-agent init, --dry-run, first savings | | Supported Agents | setup detail, override controls, degradation | | Agent Coverage | what each agent's hook API lets RTK do | | What RTK Optimizes | every command and its filter | | Configuration | config.toml, env vars, recall recovery | | Token Savings Analytics | rtk gain in full | | Pipelines | the engine: pipeline.toml, rules, judges, tasks, sharing | | RTK Proxy | the daemon: setup, what it compresses, settings | | Editions and Licensing | what each download contains | | Telemetry & Privacy | what is collected, how to opt in, your GDPR rights | | Troubleshooting | common issues, prompt-cache questions |

Repository references: engine/README.md · proxy/README.md · ARCHITECTURE.md · CONTRIBUTING.md · SECURITY.md

RTK collects no command content and no file contents. Telemetry is anonymous and off by default — it sends nothing until you opt in with explicit consent (GDPR Art. 6 & 7) via rtk telemetry enable, and documented in Telemetry & Privacy.


Editions and licence

RTK ships as three downloads. The two rtk editions install a binary with the same name — hooks, scripts and agent config work unchanged across both — so they cannot be installed together. Uninstall one before installing the other.

| Download | Licence | Contains | |---|---|---| | rtk- | Apache-2.0 + BUSL-1.1 | Hook core, every command filter, and the pipeline engine | | rtk-oss- | Apache-2.0 only | Hook core and every command filter. No engine. | | rtk-proxy- | BUSL-1.1 | The RTK Proxy daemon. Never bundled with either rtk. |

Production use is free, engine and daemon included. What the BUSL grant does not cover is offering RTK or a derivative to third parties as a commercial product or service — for that, contact contact@rtk-ai.app.

curl -fsSL .../install.sh | RTK_EDITION=oss sh    # Apache-2.0 edition
brew install rtk-ai/tap/rtk-oss
Where the licence boundary falls
flowchart TD
    agent["Your coding agent"]

subgraph editions["Pick one · both install a binary named rtk"] direction LR full["rtk
Apache-2.0 + BUSL-1.1
hooks · filters · engine"] oss["rtk-oss
Apache-2.0 only
hooks · filters"] end

proxy["rtk-proxy
BUSL-1.1
compresses API traffic"]

agent -->|"command output"| full agent -->|"command output"| oss agent -.->|"API traffic"| proxy

classDef apache stroke:#2da44e,stroke-width:2px,fill:none classDef busl stroke:#0969da,stroke-width:2px,fill:none classDef mixed stroke:#8250df,stroke-width:2px,fill:none classDef plain stroke:#8c959f,stroke-width:1px,fill:none class full mixed class oss apache class proxy busl class agent plain style editions fill:none,stroke:#d0d7de,stroke-dasharray:4 4

The rtk CLI is Apache-2.0 — see LICENSE. It links one component under a different licence: rtk-engine (engine/) is BUSL-1.1, source-available: see engine/LICENSE. Its Additional Use Grant permits production use as part of the rtk binary, so running rtk is covered; using the engine on its own, or inside another product, is not until the Change Date. The rtk-proxy daemon (proxy/) is BUSL-1.1 on the same terms and ships as its own archive with its licence alongside — rtk never links it.

What the Apache-2.0 edition omits and where the licence boundary falls: Editions and Licensing


---


Community

https://github.com/rtk-ai/rtk/blob/HEAD/Star History Chart

https://github.com/rtk-ai/rtk/blob/HEAD/StarMapper

Core team

GitHub · LinkedIn GitHub · LinkedIn GitHub · LinkedIn Github · LinkedIn GitHub · LinkedIn

Contributing

Contributions welcome: a new filter, a fix, or a pipeline you publish with rtk pipeline share publish. Open an issue or PR on GitHub and read CONTRIBUTING.md first.

Join the community on Discord.

Disclaimer

See DISCLAIMER.md.

GitHub Stars & Activity

86,543Stars
5,546Forks
1,699Open issues
RustLanguage

GitHub Popularity

GitHub stars86,543
Forks5,546
Open issues1,699
Primary languageRust
LicenseApache-2.0
Stars gained today0
Created2026-01-22
Last pushed2026-11-14

Trending History

Trending statusnot on today's boards

Related GitHub Projects

1

farion1231 / cc-switch

Rust★ 155,113⑂ 0
→
2

pbakaus / impeccable

Rust★ 111,729⑂ 0
→
3

aaif-goose / goose

Rust★ 56,706⑂ 0
→
4

herdrdev / herdr

Rust★ 51,502⑂ 0
→
5

tinyhumansai / openhuman

Rust★ 42,725⑂ 0
→
6

googleworkspace / cli

Rust★ 32,360⑂ 0
→
7

morluto / rea

TypeScript★ 465,160⑂ 0
→
8

affaan-m / ECC

JavaScript★ 304,932⑂ 0
→

More Trending Repositories