Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 18, 2026·3 min de lectura

RTK — CLI Proxy That Cuts LLM Token Usage by 60-90%

RTK is a single-binary CLI proxy written in Rust that sits between your AI coding agent and shell commands, intelligently compressing tool outputs to reduce LLM token consumption by 60-90% with zero configuration.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 27/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
CLI Tool
Instalación
Single
Confianza
Confianza: Established
Entrada
RTK CLI Proxy
Comando de staging seguro
npx -y tokrepo@latest install 27408fd9-8262-11f1-9bc6-00163e2b0d79 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introduction

RTK intercepts shell command output between your AI coding agent and the terminal, intelligently compressing verbose results so the LLM sees only what matters. Written in Rust as a single static binary with zero dependencies, it drops into any workflow without configuration changes.

What RTK Does

  • Intercepts CLI output and compresses it before it reaches the LLM context window
  • Reduces token consumption by 60-90% on common dev commands like git diff, find, and ls
  • Ships as a single Rust binary with no runtime dependencies
  • Works transparently with Claude Code, Cursor, Codex CLI, and other AI coding agents
  • Preserves semantic meaning while stripping noise, whitespace, and repetitive patterns

Architecture Overview

RTK acts as a lightweight proxy layer that wraps shell commands. When the AI agent issues a command, RTK executes it, captures stdout/stderr, applies format-aware compression heuristics (different strategies for JSON, diffs, directory listings, logs), and returns the compressed output. The compression is deterministic and lossless in terms of actionable information.

Self-Hosting & Configuration

  • Install with a one-line curl command or download the binary from GitHub releases
  • No configuration file required; works out of the box with sensible defaults
  • Set RTK_ENABLED=1 to enable proxy mode for all commands
  • Customize compression levels via RTK_LEVEL environment variable (1-5)
  • Supports allowlist and blocklist patterns for selective command interception

Key Features

  • Zero-config single binary with sub-millisecond overhead per command
  • Format-aware compression: understands git diffs, JSON, file trees, and log output
  • Reduces AI coding costs proportionally to token savings
  • Open source under MIT license with an active contributor community
  • Compatible with any AI agent that shells out to the terminal

Comparison with Similar Tools

  • Native context management — Built into some agents but lacks cross-tool portability
  • Manual prompt trimming — Requires user intervention; RTK automates it
  • Output piping with grep/sed — Loses structure; RTK preserves semantic content
  • LLM context window expansion — Costs more tokens; RTK reduces the need

FAQ

Q: Does RTK change the meaning of command output? A: No. RTK strips formatting noise and repetitive patterns but preserves all actionable information the LLM needs to make decisions.

Q: Does it work with any AI coding agent? A: Yes, it works with any tool that executes shell commands, including Claude Code, Cursor, Codex CLI, and custom agent setups.

Q: What is the performance overhead? A: Sub-millisecond per command invocation. The Rust binary is compiled to native code with no garbage collection pauses.

Q: Is it open source? A: Yes, RTK is fully open source under the MIT license.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados