RTK hooks into AI coding agents and compresses noisy shell output, diffs, logs, and tests before the model reads them. A single Rust binary can cut command-output tokens on everyday dev commands.
Overview
RTK is a cost reduction engine aimed at people who use AI coding agents. It sits between your terminal and the agent, rewriting shell commands and shrinking what comes back—test runs, git diffs, build logs, and similar output—so less text enters the agent’s context.
After install, hooks in supported agents route commands through RTK filters. More than a hundred common commands are handled, with summaries instead of long streams where passing output adds little value. The rtk gain command reports estimated savings on the machine where RTK runs.
Optional pipelines add rules in a single agent-agnostic file: compressing non-shell reads, sending large files to a cheaper model, trimming API traffic while keeping the prompt cache intact, or making agent replies more terse. An optional proxy daemon can apply similar compression to provider API calls.
RTK integrates with many AI coding tools through init hooks, plugins, or rules files. Failed filters fall back to raw command output, and rtk bypass runs a command without filtering when you need the full text.
Key features
- Compressed output for 100+ dev commands
- Automatic agent hooks after rtk init
- Token savings tracking via rtk gain
- Optional pipeline.toml customization
- Optional RTK Proxy for API traffic
- Fails open to raw output on filter errors
- Supports 18 AI coding tools
- Single Rust binary installation
Use cases
- Lowering input tokens for agent-assisted coding
- Shrinking git and test output in agent sessions
- Sharing pipeline rules across agents
- Measuring per-command savings locally
- Routing large file reads to cheaper models