# RTK: the savings number is about output bytes, and four different version numbers describe the same binary

> rtk-ai/rtk is a Rust proxy that filters shell output before an agent reads it. The README is more careful than the repository description: it says the percentages are about bash output, not about your bill, and that the token counts are estimated as bytes divided by four because the project ships no tokenizer. The version numbers, on the other hand, disagree with each other.

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

- Repository: https://github.com/rtk-ai/rtk
- Website: https://www.rtk-ai.app
- Stars: 81,911 · Forks: 5,195
- Language: Rust
- License: Apache-2.0
- Published: 2026-08-08 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/rtk-ai-rtk

## The 90 percent is about bash output, and the README walks back the rest

The headline is that RTK cuts up to 90 percent of the bash output your agent reads. Two paragraphs later the README explains what that does not mean. 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.

That paragraph is the most useful thing in the file, and it sits directly under the table of what RTK does to each command's output.

Consequence for the reader: a tool that compresses one input channel cannot promise a proportional cut in cost, and the README says so in the project's own voice rather than leaving you to discover the arithmetic. Treat the percentage as a property of the pipeline from the shell to the model context, not as a property of your invoice. The repository description, which says 60-90 percent of LLM token consumption, states it more strongly than the README does.

## Token counts are bytes divided by four, because there is no tokenizer in the binary

The savings dashboard reports token numbers, and the README says how it gets them: estimated as bytes / 4, because RTK ships no tokenizer. The stated consequence is that the percentages are reliable while the absolute token numbers are approximate.

A ratio survives a constant multiplier. If every input and every output byte is divided by the same four, then the share of bytes removed is the share of tokens removed, and the ratio holds. The absolute figure does not survive, because a four-bytes-per-token rule ignores the actual distribution of your command output.

Consequence for the reader: you can trust the percentage and you cannot trust the number next to it. If a dashboard line says it saved 42,000 tokens, the defensible reading is that it removed roughly 168,000 bytes, and how many tokens that was depends on a tokenizer this project does not carry. Anyone budgeting from the absolute figure is budgeting from a constant.

## The manifest, the tags, and the README's own check all name a different version

Cargo.toml declares version 0.49.0 with edition 2024 and rust-version 1.91. The three most recent releases are dev-0.51.0-rc.478, dev-0.51.0-rc.473, and dev-0.51.0-rc.472, all dated 2026-09-28, which is a release candidate line two minors above the manifest.

Then there is the verification step the README tells you to run after installing:

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

The expected output in the documentation is 0.28.2, which is a version the manifest and the release list both sit well above.

Consequence for the reader: a first-time installer who compares rtk --version against the README concludes something is wrong, and the check that exists to confirm a good install instead produces a mismatch. Since every recent tag carries a dev- prefix, a release-candidate build is what the tags point at, so the gap between the documented version and the current one is a documentation gap rather than a build problem.

## The description says zero dependencies and the manifest lists twenty-one

The repository description advertises a single Rust binary with zero dependencies. The dependencies table in Cargo.toml lists twenty-one direct crates, including clap with the derive feature, serde and serde_json, rusqlite with the bundled feature, regex, walkdir, ignore, chrono, tempfile, sha2, ureq, flate2, quick-xml, which, toml, toml_edit, colored, dirs, getrandom, encoding_rs, codepage, oem_cp, and anyhow.

A comment above three of them explains why the Windows set is not behind a cfg. encoding_rs, codepage, and oem_cp exist for console code page decoding of child-process output, and they are kept off the cfg(windows) target on purpose so the mapping and the incremental UTF-8 walk stay compiled, and unit-tested, on every platform. Only the code page lookup is Windows-specific. codepage covers the ANSI and DBCS pages encoding_rs implements, and oem_cp covers the legacy OEM and DOS pages such as 437 and 850 that it does not.

Consequence for the reader: a build that claims no dependencies is really a build with a vendored SQLite, a bundled HTTP client, and a cross-platform text decoder, and the cross-platform one is a deliberate engineering cost rather than an oversight. Anyone with a supply-chain policy has to read this table rather than the description.

## The install script is fetched from master while the default branch is develop

The quickest install for Linux and macOS pipes a remote script into a shell:

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

The URL names refs/heads/master, and the repository's default branch is develop. The README's own note about branches appears nowhere near this command, so the two facts sit in different files.

The alternatives avoid the question. Homebrew is the recommended path with brew install rtk, Windows has winget install rtk-ai.rtk, and Cargo is cargo install --git https://github.com/rtk-ai/rtk, which builds from the repository rather than from a registry.

Consequence for the reader: the script you pipe into a shell is fetched from a branch that is not the branch the project treats as current, and it is the path with the least review. The install places the binary in ~/.local/bin, and the README's next line appends an export PATH entry to ~/.bashrc or ~/.zshrc, so the quick install also edits your shell profile.

## The hook only catches Bash calls, so Read, Grep and Glob are not compressed

RTK installs itself into an agent with rtk init, and there are eleven agent variants in the list, from a default global install for Claude Code and Copilot through flags for Gemini, Codex, and agent names for cursor, windsurf, cline, kilocode, antigravity, kimi, pi, omp, and hermes.

Hook-based agents get their Bash commands rewritten before execution, so git status becomes rtk git status. Plugin-based agents, Hermes among them, use a plugin API for the same rewrite. Then the README states the limit plainly: the hook only runs on Bash tool calls, and Claude Code built-in tools like Read, Grep, and Glob do not pass through the Bash hook, so they are not auto-rewritten. The suggested workaround is to use shell commands such as cat, head, tail, rg, grep, and find instead, or to call rtk read, rtk grep, or rtk find directly.

Consequence for the reader: an agent that reads most files with its built-in Read tool is running the uncompressed path for most of its reading. The savings you get depend on the agent's tool preferences, not on RTK's filters, and the dashboard cannot tell you which path a given call took.

## A different rtk exists on crates.io, and the check that reveals it is rtk gain

The README carries a name collision warning. Another project named rtk, described as a Rust Type Kit, exists on crates.io. If rtk gain fails, the advice is that you have the wrong package, and the fix is to use the cargo install --git command instead of the registry one.

The binary names on offer from the releases page are also platform-specific in a way worth reading before you download. macOS has rtk-x86_64-apple-darwin.tar.gz and rtk-aarch64-apple-darwin.tar.gz. Linux has rtk-x86_64-unknown-linux-musl.tar.gz and rtk-aarch64-unknown-linux-gnu.tar.gz, so the static musl build is x86_64 and the gnu build is aarch64. Windows has one archive, rtk-x86_64-pc-windows-msvc.zip.

Consequence for the reader: there is no aarch64 Windows archive and no aarch64 musl Linux archive, so an ARM Linux machine on musl has to build from source. The collision warning also means a plain cargo install rtk can install something that shares the name and none of the behaviour, and the only way to tell is to run a subcommand and see whether it exists.

## Windows gets a separate set of instructions because of what the hook needs

The Windows notes are longer than any other platform's. Extract the zip and place rtk.exe somewhere on your PATH, for example under the user profile. Run RTK from Command Prompt, PowerShell, or Windows Terminal, and not by double-clicking the executable, because it flashes and closes. The Cargo manifest explains the underlying reason in one comment: child-process output has to be decoded through the console code page, which is why windows-sys is pulled in with the Win32_System_Console and Win32_Globalization features, and why the sibling crates on the other side of that boundary are compiled everywhere.

The README states that the full hook system works natively on Windows and in WSL.

Consequence for the reader: the Windows path is the one where the install is manual, the PATH entry is yours to make, and a wrong launch method looks like a crash. That is the same code path as everywhere else, and the cost of it is entirely in the wrapping.

## Conclusion

Use RTK if your agent runs a lot of shell commands whose output is long and mostly uninteresting, since that is the case its filters are built for, and you are willing to audit which of your tools actually route through the hook. Do not adopt it on the strength of a cost estimate: the README itself says the reduction dilutes at every step between bash output and the invoice, and that absolute token numbers are approximate because there is no tokenizer in the binary. Before you install, check three things: which install path you take, because cargo install without --git pulls a different project from crates.io, whether the commands you care about are Bash tool calls or built-in tools like Read and Grep, and what version you actually installed, since the manifest, the release tags, and the README's own verification example each name a different one.

## FAQ

### What is RTK for AI?

RTK is a Rust CLI proxy that intercepts shell commands and filters and compresses their output before an agent reads it. It supports more than 100 commands, and the README states under 10ms of overhead. For example, git log is reduced to hash, author and subject, and cargo test output is reduced to failures with passing tests collapsed to a count.

### How do I install rtk AI?

The recommended path on macOS and Linux is brew install rtk, and Windows uses winget install rtk-ai.rtk. A shell script is available for Linux and macOS, and cargo install --git https://github.com/rtk-ai/rtk builds from the repository. A plain cargo install can fetch a different project also named rtk from crates.io.

### What does an RTK proxy do?

It sits between the agent and the command. The agent issues git status, RTK runs git, filters the output, and returns a compact version, so the agent never reads the raw text. The README lists four strategies applied per command type, starting with smart filtering that removes comments, whitespace and boilerplate, and grouping that aggregates similar items.

### How do I use rtk with Claude Code?

Run rtk init -g, which is the default global install for Claude Code and Copilot. The hook then rewrites Bash commands before execution, so git status becomes rtk git status. Built-in tools such as Read, Grep and Glob do not pass through the Bash hook and are not rewritten.

## Sources

- [Official documentation](https://www.rtk-ai.app)
- [Official README](https://github.com/rtk-ai/rtk#readme)
- [Project repository](https://github.com/rtk-ai/rtk)
- [Release notes](https://github.com/rtk-ai/rtk/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/rtk-ai-rtk
