rtk: Strips terminal noise from AI coding sessions

Project Overview

The LLM coding landscape has a dirty secret: most of what you pay for is whitespace, repetitive test output, and noise. RTK (Rust Token Killer) sits as a transparent proxy between your terminal and your AI coding assistant, stripping that cruft before it ever reaches the context window. With 43,310 stars and a Rust core that adds under 10ms of overhead, it’s one of the fastest-growing tools in the agentic coding ecosystem — and for good reason. Where alternatives like prompt compression libraries operate on the text after it’s been generated, RTK intercepts at the shell level, rewriting commands like git diff or npm test to emit only the signal. The architecture document reveals a deliberate choice: rather than parsing every possible output format, RTK ships with 100+ command-specific filters, each tuned to extract the minimal useful representation. This is a project that understands that in AI coding, context window is your most expensive resource.

What It’s For

If you’re using Claude Code, Copilot, Gemini CLI, or any agentic coding tool that runs shell commands, RTK is designed for you. The core insight is that these tools spend a shocking amount of their context budget on boilerplate: git status output showing 300 files when only 3 changed, cargo test printing every passing assertion, docker ps with column headers that never change. RTK’s hook system transparently rewrites these commands at the shell level — the AI never knows the difference, it just sees compressed output. The savings are real: a 30-minute Claude Code session that would normally consume ~118,000 tokens drops to ~23,900 tokens across the board, with particularly dramatic reductions on git add/commit/push sequences (-92%) and test runners (-90%). The tradeoff is that this only applies to commands routed through the Bash hook — Claude’s built-in Read, Grep, and Glob tools bypass it entirely, so you’ll need to consciously use shell alternatives for those workflows.

How to Use It

The primary workflow is a two-step activation: install RTK, then initialize its shell hook for your AI tool. The rtk init -g command sets up a transparent Bash hook that rewrites commands like git status into rtk git status before execution — the AI never sees the rewrite, it just gets compressed output. For Claude Code specifically, this means every shell command the agent runs automatically passes through RTK’s filter pipeline. The ‘gain’ command provides a running tally of tokens saved, which is useful for cost tracking and fine-tuning which filters to enable. One subtlety worth noting: because the hook operates at the Bash level, it won’t intercept Claude’s built-in tools like Read or Grep — those bypass the shell entirely. The documented workaround is to use shell equivalents like cat or rg instead, though this requires remembering to do so mid-session.

Installs the transparent Bash hook for Claude Code and Copilot, rewriting commands like git status to compressed versions automatically

rtk init -g

Displays a running tally of token savings from RTK’s compression, useful for tracking cost reduction and verifying filters are working

rtk gain

Initializes RTK’s hook specifically for Cline or Roo Code, adapting the hook configuration to that tool’s shell invocation pattern

rtk init --agent cline

Recent Updates

Latest Release: v0.39.0 (2025-01-01)

Latest stable release with expanded command support and improved filter accuracy

The project shows active development with release candidates reaching v0.40.0-rc.204, suggesting rapid iteration. The Discord community at 1,470+ members indicates strong adoption, and the Homebrew formula availability has lowered the barrier for macOS users significantly. The trajectory suggests a project that’s still finding its footing on stability while expanding coverage.


Sources & Attributions

[1] RTK has 43,310 stars on GitHub — rtk-ai/rtk [2] Token savings estimates from a 30-minute Claude Code session on medium-sized TypeScript/Rust projects — rtk-ai/rtk README [3] Latest stable release is v0.39.0 — rtk-ai/rtk@v0.39.0 [4] Discord community has 1,470+ members — rtk-ai/rtk README