gitmyhub

rtk

Rust ★ 71k updated 3d ago

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Local CLI proxy that intercepts AI coding assistant requests and compresses context to reduce token usage by 60, 90%, lowering API costs and rate-limit pressure.

RustCLIProxysetup: moderatecomplexity 3/5

RTK is a local CLI proxy that sits between your AI coding assistant and the LLM provider it calls, with the goal of dramatically reducing the number of tokens consumed per session. According to the project, it achieves a 60 to 90 percent reduction in token usage, which translates directly into lower API costs or fewer rate-limit hits when working with tools like Claude Code, GitHub Copilot, or Cursor.

It works by intercepting the outgoing requests that your AI coding tool makes to its backend model, transforming or compressing the context before forwarding it. Because it hooks into the bash command layer that tools like Claude Code use when invoking shell commands, it can operate without modifying the AI tool itself. The proxy runs locally on your machine and the AI assistant's configuration is updated to route requests through it.

You would use RTK when your AI coding sessions are consuming tokens faster than your budget or subscription allows, or when you are hitting context limits that cut off long conversations. It is particularly relevant for heavy users of Claude Code, Codex, or Cursor who run extended sessions on large codebases and find that context window costs or limits become a practical constraint.

The project is written in Rust, which gives it low overhead as a local proxy process. It is designed to be transparent to the user: once configured, the AI coding tool behaves the same as before but the underlying requests are more token-efficient. This makes it a cost-optimization layer rather than a change to the AI tool's functionality.

Where it fits