A plugin-based harness that gives Claude Code, Codex and other coding agents shared agents, skills, hooks, memory and security scanning.
rtk-ai/rtk
CLI proxy that filters and compresses shell command output before it reaches an AI coding agent's context, cutting token use.
- Stars
- 83,930
- Forks
- 5,334
- Open issues
- 1,543
- Last commit
- 17 hours ago
What is it?
RTK sits between an AI coding agent and the shell. When the agent runs commands such as git status, git diff, grep, ls, cargo test or pytest, RTK rewrites the output into a shorter form: failures only for test runs, grouped matches for search, file counts for directory listings, and trimmed diffs. The stated goal is a 60-90% reduction in tokens for these common developer commands, which lowers context cost for the agent.
It ships as a single Rust binary and covers 100+ commands across Git, Cargo, npm, Python, Go, Docker, Kubernetes, AWS and Terraform. Integration is handled by an init command that installs hooks for supported agents, including Claude Code, Cursor, Gemini CLI, Codex, Windsurf, Cline and Copilot, so the agent receives compact output without calling rtk explicitly. The project also offers rtk gain for reporting savings and an optional rtk-proxy daemon for compressing provider API traffic.
The project is dual-licensed: the rtk CLI is Apache-2.0, while the compression engine and proxy are under BUSL-1.1, with a separate Apache-2.0-only edition available.
Key features
- 01Rewrites common shell commands such as git, grep, ls and test runners into compact output.
- 02Ships as a single Rust binary with no runtime dependencies.
- 03Installs agent hooks for Claude Code, Cursor, Gemini CLI, Codex, Copilot and many others.
- 04Reports token savings with rtk gain, including history and JSON export.
- 05Offers rtk bypass to run a single command unfiltered while still tracking it.
Use cases
- Reducing token cost when running an AI coding agent on large repositories with verbose test or build output.
- Keeping an agent's context focused by collapsing passing tests and noisy git diffs.
- Measuring which commands would benefit from filtering using rtk discover and rtk gain.
Quick start
- 1
Install RTK with Homebrew (macOS / Linux)
brew install rtk - 2
Install the hook for your AI tool (Claude Code default)
rtk init -g - 3
Restart your AI tool, then check the savings dashboard works
rtk gain
Things to know
- The hook only fires on Bash tool calls; built-in tools like Read, Grep and Glob are not rewritten.
- Token counts are estimated as bytes / 4, so absolute numbers are approximate.
- Two editions install a binary with the same name, so they cannot be installed together.
- Commercially offering RTK or a derivative to third parties requires a separate BUSL-1.1 licence.
Topics
FAQ
- What is rtk?
- CLI proxy that filters and compresses shell command output before it reaches an AI coding agent's context, cutting token use. RTK sits between an AI coding agent and the shell. When the agent runs commands such as git status, git diff, grep, ls, cargo test or pytest, RTK rewrites the output into a shorter form: failures only for test runs, grouped matches for search, file counts for directory listings, and trimmed diffs. The stated goal is a 60-90% reduction in tokens for these common developer commands, which lowers context cost for the agent.
- Is rtk free to use? What license does it have?
- rtk is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is rtk still maintained?
- Actively maintained. The last commit to rtk was on Oct 19, 2026.
- What can I use rtk for?
- Reducing token cost when running an AI coding agent on large repositories with verbose test or build output. Keeping an agent's context focused by collapsing passing tests and noisy git diffs. Measuring which commands would benefit from filtering using rtk discover and rtk gain.
- How do I install rtk?
- Install RTK with Homebrew (macOS / Linux): brew install rtk Install the hook for your AI tool (Claude Code default): rtk init -g Restart your AI tool, then check the savings dashboard works: rtk gain
- Where can I get rtk?
- The source code and installation instructions are on GitHub: https://github.com/rtk-ai/rtk
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Local CLI and desktop app that breaks down your AI coding token spend and cost by tool, model, project and task.
A minimal Rust-built statusline for Claude Code showing model, Git state, workspace, and context window usage in the terminal.
A modular runtime and orchestration system that coordinates AI coding agents through gated pipelines for tasks, review, shipping and docs across Claude Code, Codex, Cursor and more.
A CLI that manages a team's AI coding assets (skills, rules, agents, MCP servers, models) in a shared git repo and syncs them to teammates' AI tools.
A CLI that scans your codebase and generates compact AI context files (CLAUDE.md, .cursorrules, AGENTS.md) so coding assistants spend fewer tokens exploring the project.