← all repositories
rtk-ai/rtk

A Rust proxy that trims 80% of your LLM token bloat

rtk intercepts common dev commands and feeds your AI only the compressed essentials, slashing token consumption by 60–90%.

rtk
Velocity · 7d
+200
★ / day
Trend
cooling
star history

What it does

rtk sits between your AI coding agent and the shell, filtering and compressing command output before it lands in the LLM context window. It is a single Rust binary that rewrites verbose terminal noise—directory listings, test logs, and version-control diffs—into compact summaries. The README claims this cuts token consumption by 60–90% across more than a hundred supported commands with under 10 ms of overhead.

The interesting bit

The hook-based integration is the main event: it transparently intercepts shell tool calls from agents like Claude Code and rewrites them so the LLM never sees the raw output. For everything else, it applies four strategies—smart filtering, grouping, truncation, and deduplication—tailored per command type rather than using a generic text compressor.

Key highlights

  • Claims 60–90% token reduction on common dev workflows; a sample 30-minute session drops from roughly 118,000 tokens to about 23,900.
  • Supports 100+ commands spanning version control, test runners, AWS CLI, containers, and package managers.
  • Single static Rust binary with zero runtime dependencies.
  • Includes built-in analytics to track token savings over time.
  • Offers an ultra-compact mode for even more aggressive output shrinking.

Caveats

  • The shell hook does not catch built-in agent tools like Claude Code’s Read, Grep, or Glob; you must fall back to shell equivalents or explicit rtk calls.
  • On Windows, the full hook system is described as working best under WSL; the native experience is more limited.

Verdict

Worth a look if you pay per token or constantly hit context limits with agentic coding tools. If your LLM usage is already cheap or you rely heavily on built-in agent tools that bypass the shell, the friction may outweigh the savings.

Frequently asked

What is rtk-ai/rtk?
rtk intercepts common dev commands and feeds your AI only the compressed essentials, slashing token consumption by 60–90%.
Is rtk open source?
Yes — rtk-ai/rtk is open source, released under the Apache-2.0 license.
What language is rtk written in?
rtk-ai/rtk is primarily written in Rust.
How popular is rtk?
rtk-ai/rtk has 72.7k stars on GitHub and is currently cooling off.
Where can I find rtk?
rtk-ai/rtk is on GitHub at https://github.com/rtk-ai/rtk.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.