rtk-optimizer
Original:🇺🇸 English
Translated
Optimize command outputs with RTK (Rust Token Killer) for 70% token reduction
3installs
Added on
NPX Install
npx skill4agent add florianbruniaux/claude-code-ultimate-guide rtk-optimizerTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →RTK Optimizer Skill
Purpose: Automatically suggest RTK wrappers for high-verbosity commands to reduce token consumption.
How It Works
- Detect high-verbosity commands in user requests
- Suggest RTK wrapper if applicable
- Execute with RTK when user confirms
- Track savings over session
Supported Commands
Git (>70% reduction)
- →
git log(92.3% reduction)rtk git log - →
git status(76.0% reduction)rtk git status - →
find(76.3% reduction)rtk find
Medium-Value (50-70% reduction)
- →
git diff(55.9% reduction)rtk git diff - →
cat <large-file>(62.5% reduction)rtk read <file>
JS/TS Stack (70-90% reduction)
- →
pnpm list(82% reduction)rtk pnpm list - /
pnpm test→vitest run(90% reduction)rtk vitest run
Rust Toolchain (80-90% reduction)
- →
cargo test(90% reduction)rtk cargo test - →
cargo build(80% reduction)rtk cargo build - →
cargo clippy(80% reduction)rtk cargo clippy
Python & Go (90% reduction)
- →
pytest(90% reduction)rtk python pytest - →
go test(90% reduction)rtk go test
GitHub CLI (79-87% reduction)
- →
gh pr view(87% reduction)rtk gh pr view - →
gh pr checks(79% reduction)rtk gh pr checks
File Operations
- →
ls(condensed output)rtk ls - →
grep(filtered output)rtk grep
Activation Examples
User: "Show me the git history"
Skill: Detects → Suggests → Explains 92.3% token savings
git logrtk git logUser: "Find all markdown files"
Skill: Detects → Suggests → Explains 76.3% savings
findrtk find "*.md" .Installation Check
Before first use, verify RTK is installed:
bash
rtk --version # Should output: rtk 0.16.0+If not installed:
bash
# Homebrew (macOS/Linux)
brew install rtk-ai/tap/rtk
# Cargo (all platforms)
cargo install rtkUsage Pattern
markdown
# When user requests high-verbosity command:
1. Acknowledge request
2. Suggest RTK optimization:
"I'll use `rtk git log` to reduce token usage by ~92%"
3. Execute RTK command
4. Track savings (optional):
"Saved ~13K tokens (baseline: 14K, RTK: 1K)"Session Tracking
Optional: Track cumulative savings across session:
bash
# At session end
rtk gain # Shows total token savings for session (SQLite-backed)Edge Cases
- Small outputs (<100 chars): Skip RTK (overhead not worth it)
- Already using Claude tools: Grep/Read tools are already optimized
- Multiple commands: Batch with RTK wrapper once, not per command
Configuration
Enable via CLAUDE.md:
markdown
## Token Optimization
Use RTK (Rust Token Killer) for high-verbosity commands:
- git operations (log, status, diff)
- package managers (pnpm, npm)
- build tools (cargo, go)
- test frameworks (vitest, pytest)
- file finding and readingMetrics (Verified)
Based on real-world testing:
- : 13,994 chars → 1,076 chars (92.3% reduction)
git log - : 100 chars → 24 chars (76.0% reduction)
git status - : 780 chars → 185 chars (76.3% reduction)
find - : 15,815 chars → 6,982 chars (55.9% reduction)
git diff - : 163,587 chars → 61,339 chars (62.5% reduction)
read file
Average: 72.6% token reduction
Limitations
- 446 stars on GitHub, actively maintained (30 releases in 23 days)
- Not suitable for interactive commands
- Rapid development cadence (check for breaking changes)
Recommendation
Use RTK for: git workflows, file operations, test frameworks, build tools, package managers
Skip RTK for: small outputs, quick exploration, interactive commands
References
- RTK GitHub: https://github.com/rtk-ai/rtk
- RTK Website: https://www.rtk-ai.app/
- Evaluation:
docs/resource-evaluations/rtk-evaluation.md - CLAUDE.md template:
examples/claude-md/rtk-optimized.md