RTK

rtk-ai/rtk

Cut LLM token use on common dev commands

PersonalCoding assistantsCLIExtension / pluginPermissive

At a glance

stars on GitHub
88k
contributors
216+
last commit
latest release, 5 days ago
v1.2.1
license
Apache-2.0

About

RTK is a single Rust binary that rewrites the shell commands a coding agent runs (git, test runners, linters, ls, grep and more than 100 others) and hands back a compact version of their output, so the agent reads fewer tokens. One rtk init command adds a hook to Claude Code, Codex, Cursor, Gemini CLI and other agents, and rtk gain shows how much output it saved.

From the repository: “CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies”

What does RTK do for Claude Code and other coding agents?

RTK sits between your coding agent and the shell. After rtk init, a hook rewrites commands such as git status into rtk git status, and RTK returns a shorter version of the output: test runners show only failures, git log shows hash, author and subject, and directory listings become a tree with file counts. The agent does not need to know RTK exists. The hook only fires on shell (Bash) tool calls, so built-in tools such as Claude Code's Read, Grep and Glob are not compressed. rtk gain shows your savings, and rtk discover lists commands that could have been compressed.

How much does RTK really save?

RTK reports up to 90% smaller output on the commands it supports, but its own README explains why your bill falls by less. Command output is only one part of the input tokens, next to your prompt, the system prompt and the conversation history, and input tokens are only part of the bill. RTK has no tokenizer: it estimates tokens as bytes divided by four, so its percentages are reliable but the token counts are approximate. The project also says RTK does not break Claude's prompt cache, because each command is filtered once and the shorter result is cached normally.

What are the alternatives to RTK?

Headroom, in our catalog, also compresses tool output before it reaches the model, but it works as a library, proxy or MCP server and also handles logs, files and RAG chunks, so it takes more setup. Context Mode, also in our catalog, keeps large tool output in a sandbox and saves session memory through MCP and hooks; check its license before company use. Caveman works on the other side: it makes the agent answer in short sentences to cut output tokens, and it can run next to RTK. Coding agents such as Qwen Code, Kilo Code and Aider are tools RTK works with, not alternatives to it.

Is RTK free and open source?

It is free to use, but not all of it is open source. The rtk command-line tool is Apache-2.0. The default download also includes the compression engine, which is under the Business Source License (BUSL-1.1): it is source-available, production use is allowed for free, and each version becomes Apache-2.0 on 9 September 2030 or four years after its release, whichever comes first. You may not offer RTK or a derivative to others as a commercial product or service. The rtk-oss edition is Apache-2.0 only and leaves out the engine. Telemetry is off unless you turn it on with rtk telemetry enable.

What are the limits of RTK?

Coverage depends on each agent's hook system. Claude Code, Codex, Cursor and Gemini CLI get a real command rewrite, but some tools only receive rules files (Windsurf, Cline) or a deny-with-suggestion step (GitHub Copilot CLI). Compact output can hide a detail the agent needs; rtk bypass runs one command unfiltered. Another, unrelated project called rtk (Rust Type Kit) exists, so cargo install rtk may install the wrong tool: use the Git URL or Homebrew and check that rtk gain works. On Windows some filters need ripgrep installed. Popular open requests ask for more agents and commands, such as Kiro CLI and Flutter.

Why it's in the catalog

Worth installing if you use Claude Code, Codex or a similar agent that runs many shell commands: setup is one command and easy to undo. It shrinks command output only, so your total bill drops by less than the headline percentage, and commands that do not go through the shell hook are not touched. Pick the rtk-oss edition if your company does not allow source-available (BUSL) code.

Get it

brew install rtk-ai/tap/rtk
rtk init -g
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
rtk init -g
winget install rtk-ai.rtk
rtk init -g

Latest release: v1.2.1, . Its files were downloaded 88,246 times.

All files (30)

Windows

macOS

Linux

To check the files: checksums.txt

These files come from the project's GitHub release. DigGitHub does not check them.

RTK and its alternatives: GitHub stars, last commit, license and worth score
ProjectStarsLast commitLicenseWorth
RTKThis project
88k (best)Apache-2.092
Loop EngineeringPatterns and tools for loops with coding agents
12kMIT74
Kilo CodeOpen-source agentic engineering platform
28kMIT82
Qwen CodeOpen-source coding agent in the terminal
31kApache-2.095 (best)
CodewhaleRust coding agent for the terminal
41kMIT82

▲ marks the most stars and the best worth score.

rtk-ai.app
Preview of RTK
Preview of RTK at rtk-ai.app

Featured in

Topics