RTK: One Rust Binary That Shrinks Shell Output for 18 Coding Agents

By Indie Kings | November 4, 2026

Updated November 4, 2026: RTK, expanded as Rust Token Killer, is an agent-agnostic token optimization layer that intercepts shell commands and compresses their output before your AI agent reads it. It is a single Rust binary, supports 100 or more commands, reports less than 10 milliseconds of overhead, and preserves facts. The rtk CLI is Apache-2.0 with one BUSL-1.1 component, rtk-engine, and the same README states that production use of the engine is free.

Star history chart for rkt-ai/rtk, showing the repository going from an early spike to a sustained rise through 2026

Image: The star history chart for rtk-ai/rtk from the project's README. Credit: rtk-ai/GitHub.

Per the official repository README, RTK intercepts shell commands and compresses their output before your agent reads it. It is written in Rust, ships as a single binary, and reports less than 10 milliseconds of overhead. It is not a hosted compression service. The command output is filtered on your machine before the agent sees it, and the RTK proxy is a separate optional daemon for provider-API traffic.

RTK's simplest claim is the most useful one: agents burn input tokens on shell output that nobody needed, and that output is the easiest category of token to cut. A test suite that passes 2,000 tests and fails one should not arrive as 2,000 pass lines. A git diff does not need its headers and unchanged context. A tree listing with ten thousand one-line entries should not beat the file that matters. RTK sits between the agent's Bash tool and the shell to make that output smaller.

One binary, not a SaaS

The installation is intentionally mundane. RTK is available through Homebrew, winget and a shell installer, and the README tells you to check that you installed the right package because another project named rtk exists on crates.io. The command rtk version must show a current RTK version, and rtk gain must show the savings dashboard, not "command not found". That is the kind of guard rail that matters when a small named tool is easy to mistake for another small named tool.

What you get is three downloads with a naming collision. The rtk edition includes the hook core, the command filters and the compression engine. The rtk-oss edition is Apache-2.0 only and includes the hook core and the filters, without the engine. The rtk-proxy daemon is BUSL-1.1 and ships separately as its own archive; rtk never links it. The two rtk editions both install a binary named rtk, so they cannot coexist, and the README says to uninstall one before installing the other.

RTK is not only a filter for an existing terminal. The hook fires on Bash tool calls only; built-in tools like Read, Grep and Glob do not pass through it. Use shell commands such as cat and rg, or call rtk read and rtk grep directly. That is the detail most users will miss, because the README says "your agent receives compact output", not that every path into the agent is intercepted.

How the filters work

The README lists four strategies. Smart Filtering removes noise, including comments, whitespace and boilerplate. Grouping aggregates similar items such as files by directory and errors by type. Truncation keeps relevant context while cutting redundancy. Deduplication collapses repeated log lines with counts. The filter table shows each command's compression shape: a tree instead of one line per file, signatures and structure instead of full file bodies, long lines truncated and matches grouped by file, git status grouped by state, git diff with reduced context and headers stripped, test runners collapsed to failures, and docker ps trimmed to essential fields.

Two escape hatches make the filters survivable. Bypassing the filter for one command prints the raw output and still counts it in the history with a 0 percent reduction, which is how you separate a filter bug from a real failure. rtk proxy is now a deprecated alias of rtk bypass, while rtk llm-proxy is a different surface that manages the rtk-proxy daemon. The distinction matters because both use the word proxy, and they compress different layers of the stack.

RTK estimates reported token counts as bytes divided by four rather than by shipping a tokenizer. The README says the percentages are reliable and the absolute token numbers are approximate. That is an honest boundary: users should read the savings chart as a ratio, not as a publisher's billing statement.

Command familyWhat gets compressedWhat is kept
ls and treeOne line per entryTree format with file counts
cat and readFull file bodiesOutline and signatures
grep and rgLong lines and flat outputTruncated lines grouped by file
git status and diffProgress output and redundant contextGrouped state, reduced diff context
test runnersPassing test outputFailures only and a collapsed pass count
docker psEvery fieldEssential fields

What it saves, and what it does not

RTK is explicit that bash output is one contributor to input tokens, alongside your prompt, the system prompt and conversation history. Input tokens are also only part of the bill, because output tokens count too. A rewrite that saves 90 percent of shell output will not save 90 percent of the spend, and the README says so. That distinction is the reason for the "How Savings Work" guide, which explains the dilution at every stage.

The local analytics surface is usable without connecting to anything. rtk gain prints summary stats, rtk gain graph draws the last 30 days, history and daily mode break down adoption, and rtk gain all with JSON format exports machine-readable data. rtk discover finds missed savings opportunities, and rtk session shows how much RTK was adopted across recent sessions. These commands are the honest answer to "did it work here" because they let a developer inspect their own traffic instead of trusting a launch chart.

The optional proxy daemon goes further. rtk llm-proxy starts a local background process between the agent and the provider, compresses payloads, strips bytes no model ever needed, carries calls your pipeline routes to cheaper models, and can align prompt-cache breakpoints where the agent leaves them open. It is BUSL-1.1, ships as its own archive, and is never bundled or linked. The README scopes the integration intentionally: not every harness has a session hook, so rtk starts the daemon and execs the harness with redirection, and today that is verified for rtk claude. Other harnesses fall through to plain passthrough rather than claiming support they do not have.

18 agents, 100 commands

The supported agent list is the broadest claim in the README. Eighteen AI coding tools are listed, including Claude Code, GitHub Copilot in VS Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex, Windsurf, Cline, OpenCode, Hermes, Mistral Vibe, Google Antigravity and Trae. The integration method varies by tool: native hooks, project rule files, TypeScript plugins, Python adapters and AGENTS.md. The number of ways to hook an agent to a shell filter is itself a warning about how young the standards are.

The 100 or more commands cover Git, GitHub CLI, Rust, JavaScript, Python, Go, Ruby, .NET, JVM, PHP, Docker, Kubernetes, AWS, Terraform and the built-in file and search tools. The breadth is the value proposition for a team that has Claude Code, Codex and a shell session open at the same time. The command list is the interface contract, not an marketing claim.

One line matters for automation. The rtk binary exposes rtk rewrite, which is how an adapter can ask RTK what to do with a command rather than coupling itself to rtk's internals. That command is listed in the supported-agent inventory next to hook files and rule systems, and it is the escape hatch for new Harnesses that do not fit the first 18.

The licence boundary you need to know

RTK is not a uniformly permissive open-source project, and the README spells out the boundary. The rtk CLI is Apache-2.0 and links one BUSL-1.1 engine component. The engine's Additional Use Grant permits production use as part of the rtk binary, so running rtk is covered, but using the engine on its own or inside another product is not covered until the Change Date. The rtk-proxy daemon is also BUSL-1.1 under the same terms and ships as its own archive. The Apache-2.0-only edition omits the engine.

Production use is free in the way the BUSL grant defines for the rtk binary: you can install and run it. What the BUSL grant does not cover is offering RTK or a derivative to third parties as a commercial product or service. For that, the README gives a contact address for licensing. That is the correct licence shape for a vendor that wants an individual developer to try the tool while retaining the right to charge platform vendors later.

Telemetry is worth a sentence because every repository cites its privacy posture. RTK captures no command content and no file contents. Telemetry is anonymous, off by default, and opt-in via rtk telemetry enable, and it sends nothing until the user explicitly consents. The documentation covers GDPR Art. 6 and 7 and the stored data types. The reason this is material is that an interception layer sees every shell command the agent runs, so the privacy default has to be zero collection.

Our take: we think RTK is the right answer to a problem every coding agent user has. Output trimming is concrete, local, reversible with one bypass command and honest about being approximate. The licence boundary means it is safe for a developer to try and a business to read before embedding it in its own product line.

FAQ

What does RTK do to my agent?
It intercepts Bash calls from the agent and rewrites them to rtk equivalents, which filter the command's output before the agent reads it. Built-in tools that do not pass through Bash are not intercepted.

How many agents does it support?
The README lists 18 tools, including Claude Code, Copilot in VS Code, Copilot CLI, Cursor, Gemini CLI, Codex, OpenCode, Hermes, Mistral Vibe and Google Antigravity. Each has its own hook or rule-file mechanism.

Does it collect my code or commands?
No. Per the README, RTK captures no command content and no file contents. Telemetry is anonymous, off by default, and opt-in with explicit consent.

Can I see the unfiltered output?
Yes. rtk bypass runs one command unfiltered and still tracks it with a zero-percent reduction, which is how you check whether a filter or the command itself produced a bad result.

What is the difference between rtk and rtk-oss?
rtk includes the Apache-2.0 project plus the BUSL-1.1 engine and filters. rtk-oss is Apache-2.0 only with the hook core and the filters but no engine, and the two install the same binary name so they cannot coexist.

How much does using rtk cost my business?
Per the README, production use as part of the rtk binary is free. Offering RTK or a derivative to third parties as a commercial product or service requires a separate licence contact. Check the current grant before embedding it.

Bottom Line

RTK is the right-sized filter for shell output: one binary, 100 or more command coverage, 18 agent integrations, local execution, explicit bypass, and no content collection by default. The licence is the part to read before a team adopts it, because the core CLI is Apache-2.0 while the engine and optional proxy are BUSL-1.1. For an everyday agent session, that is not a reason to skip it. It is a reason to read the boundary.

Related: DeepInfer: DeepSeek Open Sources Its Production Inference Engine Without the Serving Layer, REA Tools: A Website for Agent-Driven Reverse Engineering

Sources: per the official RTK repository README at github.com/rtk-ai/rtk, fetched in full on November 4, 2026, including the command filter table, supported agents, proxy, pipeline, telemetry and licence sections. Repository star and fork totals were not independently re-verified on November 4, 2026 because the public API was rate-limited; do not quote a number from this article.

Share