Cut Claude Code Token Costs by Up to 89% with the Open‑Source RTK CLI

RTK is a high‑performance CLI proxy that filters and compresses command output before it reaches Claude Code’s 200k‑token LLM context, reducing token consumption by 60‑90% and cutting costs up to 89%, with step‑by‑step installation and usage instructions provided.

Su San Talks Tech
Su San Talks Tech
Su San Talks Tech
Cut Claude Code Token Costs by Up to 89% with the Open‑Source RTK CLI
Claude Code provides a 200k token LLM context. Without filtering, command output can quickly consume the context, degrading inference quality and increasing token costs. RTK is a high‑performance CLI proxy that filters and compresses command output before it reaches the LLM, reducing token consumption.

RTK Overview

RTK filters and compresses command output, achieving a 60‑90% reduction in token usage. The GitHub repository has 25k stars.

How RTK Works

Using git status as an example, the data flow changes from: Claude --git status--> shell --> git to Claude --git status--> RTK --> git Without RTK the raw command generates roughly 2,000 tokens; with RTK it is compressed to about 200 tokens.

Installation (Windows Example)

Download the installer from the RTK release page: https://github.com/rtk-ai/rtk/releases

Extract the archive to obtain rtk.exe and add its directory to the system Path environment variable, e.g. Path = D:\developer\tools\rtk Verify installation with rtk --version; the version number confirms success.

Usage

Initialize RTK globally: rtk init -g The generated CLAUDE.md configuration shows RTK instructions; Claude Code incorporates them automatically.

Running a command such as git status in Claude Code is automatically rewritten to start with rtk, ensuring the filtered flow.

After a period of use, token savings can be queried with rtk gain.

Performance Results

A developer reported nearly an 89% reduction in token consumption after several weeks of use. Charts in the original article illustrate token savings for over 30 supported commands, with the most common commands showing the highest savings.

Supported Commands

RTK supports transformation of more than 30 commands; token savings for core commands are shown in the accompanying figures.

Project URL

https://github.com/rtk-ai/rtk

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLILLMOpen SourceRTKClaude Codetoken optimization
Su San Talks Tech
Written by

Su San Talks Tech

Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.