| name | rtk |
| description | RTK (Rust Token Killer) - Token-optimized command wrapper for reducing token usage in Claude Code. Use when running development commands like cargo, git, npm, vitest, docker, kubectl, or any CLI tool where output verbosity matters. Always prefix commands with 'rtk' to automatically filter and compact output. |
RTK (Rust Token Killer)
RTK is a token-optimized command wrapper that dramatically reduces token usage when running development commands in Claude Code. It provides intelligent filtering and compaction for common development workflows.
Golden Rule
Always prefix commands with rtk. If RTK has a dedicated filter, it uses it. If not, it passes through unchanged. RTK is always safe to use.
Important: Even in command chains with &&, use rtk:
git add . && git commit -m "msg" && git push
rtk git add . && rtk git commit -m "msg" && rtk git push
Build & Compile Commands (80-90% savings)
rtk cargo build
rtk cargo check
rtk cargo clippy
rtk tsc
rtk lint
rtk prettier --check
rtk next build
Test Commands (90-99% savings)
rtk cargo test
rtk vitest run
rtk playwright test
rtk test <cmd>
Git Commands (59-80% savings)
rtk git status
rtk git log
rtk git diff
rtk git show
rtk git add
rtk git commit
rtk git push
rtk git pull
rtk git branch
rtk git fetch
rtk git stash
rtk git worktree
Note: Git passthrough works for ALL subcommands, even those not explicitly listed.
GitHub CLI Commands (26-87% savings)
rtk gh pr view <num>
rtk gh pr checks
rtk gh run list
rtk gh issue list
rtk gh api
JavaScript/TypeScript Tooling (70-90% savings)
rtk pnpm list
rtk pnpm outdated
rtk pnpm install
rtk npm run <script>
rtk npx <cmd>
rtk prisma
Files & Search Commands (60-75% savings)
rtk ls <path>
rtk read <file>
rtk grep <pattern>
rtk find <pattern>
Analysis & Debug Commands (70-90% savings)
rtk err <cmd>
rtk log <file>
rtk json <file>
rtk deps
rtk env
rtk summary <cmd>
rtk diff
Infrastructure Commands (85% savings)
rtk docker ps
rtk docker images
rtk docker logs <c>
rtk kubectl get
rtk kubectl logs
Network Commands (65-70% savings)
rtk curl <url>
rtk wget <url>
Meta Commands
rtk gain
rtk gain --history
rtk discover
rtk proxy <cmd>
rtk init
rtk init --global
Token Savings Reference
| Category | Commands | Typical Savings |
|---|
| Tests | vitest, playwright, cargo test | 90-99% |
| Build | next, tsc, lint, prettier | 70-87% |
| Git | status, log, diff, add, commit | 59-80% |
| GitHub | gh pr, gh run, gh issue | 26-87% |
| Package Managers | pnpm, npm, npx | 70-90% |
| Files | ls, read, grep, find | 60-75% |
| Infrastructure | docker, kubectl | 85% |
| Network | curl, wget | 65-70% |
Overall average: 60-90% token reduction on common development operations.
Installation
RTK is available at: https://github.com/rtk-ai/rtk
Follow the installation instructions in the repository to set up RTK in your environment.
Best Practices
- Always use
rtk prefix: Even for commands not explicitly listed, RTK will pass them through safely
- Chain commands correctly: Use
rtk before each command in a chain: rtk cmd1 && rtk cmd2
- Use
rtk proxy for debugging: When you need to see full unfiltered output
- Run
rtk discover: Periodically check for missed RTK optimization opportunities
- Check
rtk gain: Monitor your token savings over time