Verified project record
rtk-ai/rtk
RTK is a CLI proxy that reduces LLM token consumption by 60-90% during agentic coding by filtering, grouping, truncating, and deduplicating terminal command outputs. It integrates with supported AI coding tools to intercept and rewrite Bash commands transparently.
Project overview
Documented to deliver 60-90% token savings during agentic coding tasks by compressing verbose terminal outputs before they reach the LLM context.
- Project type
- AI Coding · Prompt Engineering
- Use cases
- Coding & Development
- Deployment
- Refer to project documentation
- License
- Apache-2.0
Best for
- Developers who interact with AI coding tools via terminal or shell commands and want to reduce token consumption through automated command output compression.
- Windows-based agentic coding using supported AI tools, as the auto-rewrite hook runs as a native binary command, eliminating the need for Unix shell, bash, or jq on Windows.
Key capabilities
- Intercepts and rewrites terminal commands (such as git, ls, grep, test runners, and cloud CLIs) to provide compact, token-optimized outputs using smart filtering, grouping, truncation, and deduplication.
- Transparently intercepts Bash commands from supported AI coding tools and rewrites them to RTK equivalents before execution, enabling zero-prompt token optimization.
- Provides commands to track and visualize token savings, view recent command history, and export usage stats to JSON for dashboards.
- Automatically saves full unfiltered command output to disk when a command fails, allowing the LLM to read the complete error context without re-executing the command.
Limitations and risks
- Claude Code built-in tools like Read, Grep, and Glob bypass the Bash hook and are not auto-rewritten.
- A name collision exists on crates.io with another project named 'rtk' (Rust Type Kit).
- Some filters require ripgrep (rg) to be installed and available on the system PATH.
Getting started
- Setup difficulty is rated easy. One-line installation scripts are provided for macOS/Linux (curl) and macOS (Homebrew). Pre-built binaries for Windows, Linux, and macOS are available without needing to compile from source. Coding is not required for setup.
- After installing the binary via a package manager or script, run `rtk init -g` to set up the hook for your AI tool.
Alternatives and comparisons
- Provides specialized, personality-driven AI agents for workflows, rather than terminal command output compression.
- Focuses on generating tailored design systems and UI/UX reasoning rules, unlike terminal output token optimization.
- Supplies plain-text DESIGN.md files for AI agents to generate matching UI, instead of intercepting and compressing terminal commands.
Project comparisons
Evidence and sources
- GitHub project description: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
- GitHub project description: Single Rust binary, zero dependencies
- README: High-performance CLI proxy that reduces LLM token consumption by 60-90%
- README: Four strategies applied per command type: 1. **Smart Filtering** - Removes noise (comments, whitespace, boilerplate) 2. **Grouping** - Aggregates similar items (files by directory…
- README: rtk filters and compresses command outputs before they reach your LLM context. Single Rust binary, 100+ supported commands, <10ms overhead.
AI Search
Find projects, verify facts, compare options, or turn a complex need into an actionable plan
Try a searchA click only fills the search box; you stay in control
Project Details
0