· via dev.to (home feed)
Rust CLI proxy RTK trims 60-90% of terminal tokens fed to AI coding agents
RTK, an open-source Rust CLI proxy from the rtk-ai project, intercepts shell output from AI coding agents and compresses it, with developers claiming 60-90% token reductions across common workflows.

A proxy between agents and the shell
As developers hand more terminal work to AI coding agents such as Claude Code, Cursor, Codex and OpenHands, a new bottleneck has emerged: the verbose output of everyday developer tools. Commands like git diff, test runners and package managers were designed to be read by humans, so they emit progress spinners, decorative ASCII headers and repetitive status lines. According to a dev.to post from the project's developers, all of that noise lands directly in the agent's context window whenever it runs shell commands.
RTK, short for Rust Token Killer, is an open-source CLI proxy from the rtk-ai project that aims to fix this at the source. It sits transparently between the agent and the shell, intercepting command output and compressing it before the agent ingests it. The post illustrates the effect with an example: a raw command producing 1,000 lines of output comes back as roughly 25 lines of structured, actionable context once routed through RTK.
Claimed savings and speed
The developers claim RTK cuts bash output token consumption by 60 to 90 percent across standard developer workflows. Those figures come from the project's own announcement rather than independent benchmarks, but the underlying mechanics are straightforward: fewer tokens means lower API costs, better prompt-cache efficiency and more room in the context window for the code and instructions that actually matter.
The tool is written in Rust and compiles to a single zero-dependency native binary. The dev.to post says it adds sub-10 millisecond overhead to command pipelines and makes no external network calls, running entirely offline.
Four reduction strategies
Rather than applying one generic filter, RTK applies tailored reduction logic covering more than 100 developer tools, organised around four strategies:
- Smart filtering removes comments, whitespace and progress spinners.
- Grouping aggregates related compiler errors and linter warnings by file and rule.
- Truncation strips deep, repetitive stack traces while preserving the root cause of an error.
- Deduplication collapses consecutive identical log lines into counted summaries.
Ecosystem coverage
Out of the box, the proxy ships with filters for common workflows. Git operations get compact status output, one-line commit logs and header-stripped diffs. Test frameworks including pytest, cargo test, vitest, jest, go test and Playwright have passing suites collapsed into concise summaries, with only failures highlighted. Linters and compilers such as tsc, ruff, eslint, cargo clippy and sqlfluff are covered, as is docker ps, which is filtered down to the critical status fields.
Installation and agent hooks
RTK installs via Homebrew on macOS and Linux with brew install rtk, or through Windows Package Manager with winget install rtk-ai.rtk. Integration relies on agents' native lifecycle hooks: running rtk init -g sets things up for Claude Code and Copilot, while separate flags handle Cursor and Codex. Once initialised, an agent's bash executions route through RTK automatically, with no change to how commands are issued.
Why it matters
Context window space is the scarcest resource in agentic coding. Verbose tool output crowds out architectural context, degrades caching and inflates API bills, and the problem compounds as agents run longer, more autonomous sessions. RTK treats this as a systems problem, filtering noise before it ever enters the context, rather than a prompting problem solved by asking a model to be brief. The trade-off is that aggressive filtering can hide details an agent occasionally needs: the developers say root causes and failures are preserved, but teams adopting it will want to verify that compressed output still carries everything their agents rely on.
- #rust
- #ai-agents
- #cli
- #developer-tools
- #open-source