rtk
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
RTK (Rust Token Killer) is a command-line proxy tool that reduces LLM token consumption by 60-90% on common development commands. Implemented as a single Rust binary with zero dependencies, it intercepts shell command outputs and applies intelligent filtering, grouping, truncation, and deduplication before the AI agent reads them. The tool integrates with 17 AI coding assistants including Claude Code, GitHub Copilot, Cursor, and Windsurf through auto-rewrite hooks that transparently transform commands like `git status` into `rtk git status`. By compressing verbose command outputs into compact summaries while preserving essential information, RTK significantly reduces input token costs and helps agents stay within context limits during development workflows.
Key Features
Use Cases
- 01Reducing AI agent token consumption when running Git operations (status, log, diff) in development workflows
- 02Compressing test runner output to show only failures while collapsing passing tests into counts
- 03Filtering verbose build and lint output (TypeScript, Cargo, ESLint) to essential errors and warnings grouped by file
- 04Shrinking AWS CLI, Docker, and Kubernetes command outputs to fit more operations within agent context limits
- 05Analyzing token savings across projects with gain/discover commands to identify optimization opportunities
- 06Integrating transparent command rewriting into CI/CD pipelines with non-interactive init flags
Related Plugins
View moreandrej-karpathy-skills
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
claude-mem
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
ruflo
🌊 The original agent meta-harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
rtk — FAQ
What is RTK and how does it reduce token usage?+
RTK is a CLI proxy that intercepts shell command outputs and applies filtering, grouping, truncation, and deduplication before your AI agent reads them. It reduces bash output by 60-90%, which lowers input token costs and helps keep conversations within context limits, though the overall bill reduction depends on other factors like prompts and conversation history.
How do I install RTK for Claude Code?+
Install via Homebrew (brew install rtk), winget on Windows (winget install rtk-ai.rtk), or the quick install script (curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh). Then run 'rtk init -g' to set up the auto-rewrite hook and restart Claude Code.
Which AI coding tools does RTK work with?+
RTK supports Claude Code, GitHub Copilot (VS Code and CLI), Cursor, Gemini CLI, Codex, Windsurf, Cline, Roo Code, OpenCode, OpenClaw, Pi, Oh My Pi, Hermes, Mistral Vibe, Kilo Code, Google Antigravity, Kimi AI, and Factory Droid through various hook and plugin mechanisms.
Do I need API keys or special prerequisites?+
No API keys are required. On Windows, install ripgrep (winget install BurntSushi.ripgrep.MSVC) to avoid warnings. The tool works offline with no external dependencies beyond the single Rust binary.
Is RTK free and open source?+
Yes, RTK is released under the Apache License 2.0 and is completely free to use. The source code is available on GitHub at rtk-ai/rtk.
Does RTK break Claude's prompt cache?+
No, RTK filters output once per command and the result is stored in history and cached normally on subsequent API calls. Smaller outputs actually make cache writes and reads cheaper while maintaining cache effectiveness.
How do I install rtk?+
Open the source repository on GitHub and follow its README. rtk is a plugin — MCP Agents Market links you directly to the official repo.
Is rtk free?+
rtk is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.