Fact-check (README positioning): - Template count: 120/123 → 108 (ground truth recount) - Ratio: 14× → 24× (19,000 ÷ 784 = 24.2×) - everything-cc stars: 31.9k → 45k+ (verified Feb 15) - Commands count: 20 → 23, hooks: 30 → 31 Added: - Grepai MCP documentation (semantic search, call graphs) - 3 hook templates (rtk-baseline, session-summary, session-summary-config) - 2 resource evaluations (system-prompts update, qmd token savings) Changed: - RTK documentation overhaul (v0.7.0 → v0.16.0, rtk-ai org) - Exports deprecated (kimi.pdf, notebooklm.pdf → deprecated/) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 KiB
2 KiB
RTK Token Optimization
Context: Using RTK (Rust Token Killer) to minimize token consumption from command outputs.
Commands to Optimize
Always use RTK wrapper for these high-verbosity commands:
Git Operations (92.3% avg reduction)
rtk git loginstead ofgit logrtk git statusinstead ofgit statusrtk git diffinstead ofgit diff
File Operations (69.4% avg reduction)
rtk find "*.md" .instead offind . -name "*.md"rtk read <file>instead ofcat <file>(for large files >10K lines)rtk ls .instead ofls -lartk grep "pattern"instead ofgrep -r "pattern"
JS/TS Stack (70-90% reduction)
rtk vitest runinstead ofpnpm testrtk pnpm listinstead ofpnpm listrtk pnpm outdatedinstead ofpnpm outdatedrtk prisma migrate statusinstead ofpnpm prisma migrate status
Rust Toolchain (80-90% reduction)
rtk cargo testinstead ofcargo testrtk cargo buildinstead ofcargo buildrtk cargo clippyinstead ofcargo clippy
Python (90% reduction)
rtk python pytestinstead ofpytest
Go (90% reduction)
rtk go testinstead ofgo test
GitHub CLI (79-87% reduction)
rtk gh pr view <num>instead ofgh pr view <num>rtk gh pr checks <num>instead ofgh pr checks <num>
Token Savings Target
Baseline: ~150K tokens per 30-min session With RTK: ~45K tokens (70% reduction)
Installation
# Homebrew (macOS/Linux)
brew install rtk-ai/tap/rtk
# Cargo (all platforms)
cargo install rtk
# Hook-first install
rtk init
Verification
Check RTK availability:
rtk --version # Should show: rtk 0.16.0+
When NOT to use RTK
- Quick exploration (1-2 commands): overhead not worth it
- Already using tools like Grep/Read (Claude native tools are optimized)
- Small outputs (<100 chars): minimal gain
Automation
Use RTK automatically via hook (see .claude/hooks/bash/rtk-wrapper.sh) or rtk init for hook-first setup.