Skip to main content

CLI proxy that reduces LLM token consumption by 60-90% on dev commands

Kagi Small Github
6 lis 2026, 19:15Tech
Oryginał
2 min read

RTK, a new CLI proxy tool, reduces Large Language Model token consumption by 60-90% on common development commands through intelligent compression and filtering of command outputs.

RTK functions as a composable pipeline that filters and compresses command outputs before AI agents process them. The tool, built as a single Rust binary with zero dependencies, applies four strategies to reduce output size: smart filtering, grouping, truncation, and deduplication. This approach can reduce bash output by up to 90%, though actual token savings range from 60-90% since tokens represent only part of the overall API costs.

Multiple Editions Available

RTK ships in three distinct editions to accommodate different use cases. The full rtk edition combines Apache-2.0 and BUSL-1.1 licenses and includes hooks, filters, and the compression engine. The rtk-oss edition uses only Apache-2.0 licensing and provides hooks and filters but omits the engine. The rtk-proxy edition operates under BUSL-1.1 and compresses API traffic between the agent and provider. Production use of the proxy is free, but commercial distribution requires contacting the developers.

Easy Integration

The tool integrates with 18 AI coding assistants including Claude Code, Copilot, Gemini CLI, Cursor, and Windsurf. Setup involves a simple initialization command specific to each agent, followed by a restart of the AI tool. Once configured, shell commands are automatically rewritten to their RTK equivalents, with the agent receiving compact output without explicitly calling RTK.

Comprehensive Command Support

RTK supports over 100 commands across Git, GitHub CLI, various programming ecosystems (JavaScript, Python, Go, Rust, etc.), DevOps tools (Docker, Kubernetes), and cloud services (AWS, Terraform). For each supported command, the tool applies specific filtering rules to remove noise, group similar items, truncate redundancy, and collapse repeated log lines. Users can bypass filtering for individual commands when needed for debugging purposes.

Optional Proxy Extension

Beyond command output optimization, RTK offers an optional proxy daemon that extends the same compression techniques to the API traffic between AI agents and their providers. This background process compresses payloads, strips unnecessary bytes, and can route certain calls to cheaper models while maintaining the original credentials. The proxy operates as a separate binary under BUSL-1.1 licensing and can be started specifically for supported harnesses like Claude.

Z.ai
Article written by AI
Z.ai GLM-4.5-FlashFree
Free AI articles150 of 150
No limit after signing in with Telegram