RTK for Claude Code and Codex: usage and architecture
Learn how RTK filters shell output, how Claude Code hooks differ from Codex guidance, and why raw-output recovery matters.
Player not loading? Watch on YouTube
RTK (Rust Token Killer) is an open source output proxy for coding agents. This walkthrough explains how it runs shell commands and reduces the output an agent receives. The speakers describe filters that retain test failures, compact Git results and count repeated log messages while preserving the underlying command's exit code.
The integration comparison matters for adoption. Claude Code can use a pre-tool-use hook to rewrite supported Bash commands before execution. Codex relies mainly on AGENTS.md guidance, so the speakers recommend checking command logs to confirm that it actually uses RTK. Claude Code's built-in Read, Grep and Glob tools bypass the Bash hook and therefore sit outside that filtering path.
The architecture discussion follows the Rust router, runner and stream capture layers into deterministic filters. Custom TOML filters let teams handle internal commands without writing a Rust handler for each one. The episode also covers raw-output recovery, local SQLite usage tracking, and the discover and learn commands. It reports that the official documentation describes external telemetry as disabled by default and requiring explicit consent.
Filtering is lossy. The speakers advise starting with predictable, noisy output and retaining full results when a generated file or every warning matters. Their rollout advice weighs task outcomes and recovery behavior alongside estimated token savings.