After using Claude Code to write programs for a while, I noticed a problem: every time Claude executesgit status,git logThe content returned by this type of command is often long and verbose, and all of this text will occupy the precious context window. until installedRTK (Rust Token Killer), the situation has improved significantly.
What is RTK?
RTK is a CLI proxy tool written in Rust. It is specially designed to compress CLI output and greatly reduce the token consumption of AI coding assistant. Its use is very simple - just addrtkJust prefix:
#Original
git status
# Use RTK
rtk git statusFeeling after actual installation
After installing RTK, the most direct feeling is that when Claude Code executes git commands, the content returned to the CLI is significantly reduced. beforegit statuswould spit out a bunch of file paths and teaching tips, and now only a condensed summary remains. My actual stats:
46 instructionsCumulative savings10,100 tokens (50.2%)
git statusaverage savings84.3%(7 executions, 6,200 tokens saved in total)git commitsave97.2%git stash popsave99.7%tsc --noEmitsave29.2%
What exactly does RTK do? Four core mechanisms
In order to figure out how RTK reduces tokens, I did in-depth research. RTK mainly operates through four mechanisms:
1. Structural compression: remove redundant text
bygit statusFor example, the original output has 127 lines and contains a lot of teaching prompts (such as "use git add ... to update what will be committed"). RTK removes all of these and only retains the core information:
# Original git status (line 127)
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes)
modified: src/app/[locale]/layout.tsx
modified: tsconfig.json
Untracked files:
(use "git add ..." to include in what will be committed)
.playwright-mcp/console-2026-04-12T16-17-47-909Z.log
... (and 110+ lines of file paths)
# RTK git status (line 16)
* main...origin/main
~Modified: 2 files
src/app/[locale]/layout.tsx
tsconfig.json
?Untracked: 114 files
.claude/scheduled_tasks.lock
.claude/settings.local.json
... +104 moreCompressed from 127 lines to 16 lines,86% reduction. For RTK~Represents modified,?It stands for untracked, and AI can also fully understand the status.
2. Truncation and counting: only display key items
When there are a large number of untracked files, RTK only lists the first 10, and uses... +104 moreexpress. The AI does not need to read all the file paths one by one. It is enough to know that "there are 114 untracked files".
3. Signal filtering: only retain important information
forgit log, RTK will compress multi-line Author, Date, and complete hash into a single-line format, and automatically truncate the commit message when it is too long:
# Original git log -5 (line 91)
commit 1e1e563b900682e66c6b4597e7326f6c1373ddb3
Author: tim.chao
Date: Tue Apr 14 00:20:12 2026 +0800
fix(ui): Safari tinting div...
The previous fix (4d328d7a) lowered z-index...
(full commit message)
# RTK git log -5 (line 25)
1e1e563b fix(ui): Safari tinting div... (20 minutes ago)
The previous fix (4d328d7a) lowered z-index...
[+3 lines omitted]Pressed from line 91 to line 25,59% reduction. Long commit messages are truncated and marked with omitted lines.
4. Exclusive parser for different tools
RTK is not a simple text truncation tool. It writes its own Rust parser for each supported CLI tool:
Git series:status, log, diff, commit, stash each have different compression strategies
TypeScript:
tscErrors are grouped by file and error codetesting framework: vitest, playwright Show only failed tests (90-99% savings)
Package management:pnpm install removes progress bar and redundant output (90% saving)
Lint tools:ESLint violations grouped by rules
Unknown commands will be passed through as they are, so add them at any timertkAll prefixes are safe.
Configure in CLAUDE.md
RTK support viartk init --globalWrite instructions for use~/.claude/CLAUDE.md, so Claude Code is automatically used in every conversationrtkprefix. My CLAUDE.md is configured with a complete RTK command comparison table, covering all categories such as build, test, git, GitHub, JS/TS tool chain, etc.
Conclusion
RTK is currently one of the tools with the highest CP value in my Claude Code workflow. It does not change any workflow and only needs to add a prefix before the command, which can save an average of 50% of tokens. For developers like me who use AI coding assistants extensively every day, this is equivalent to directly doubling the effective capacity of the context window. If you are also using Claude Code, I highly recommend giving it a try.