Frequently Asked Questions
Common questions about RTK (Rust Token Killer) and how it works.General
What is RTK?
What is RTK?
RTK (Rust Token Killer) is a high-performance CLI proxy that minimizes LLM token consumption by filtering and compressing command outputs. It sits between your shell commands and the LLM (like Claude Code), processing outputs to save 60-90% of tokens on common development operations.RTK achieves this through:
- Smart Filtering: Removes noise (comments, whitespace, boilerplate)
- Grouping: Aggregates similar items (files by directory, errors by type)
- Truncation: Keeps relevant context, cuts redundancy
- Deduplication: Collapses repeated log lines with counts
In a typical 30-minute Claude Code session, RTK can reduce token usage from ~150,000 to ~45,000 tokens - a 70% reduction.
How does RTK work?
How does RTK work?
RTK acts as a transparent proxy between your commands and their output:When you run
rtk git status, RTK:- Executes the real
git statuscommand - Captures the full output
- Applies command-specific filtering strategies
- Returns only the essential information
- Tracks token savings in SQLite for analytics
Is RTK safe to use?
Is RTK safe to use?
Yes. RTK is designed with safety as a priority:
- Read-only operation: RTK only filters output, it never modifies your files or git history
- Graceful degradation: If filtering fails, RTK falls back to raw command execution
- Exit code preservation: RTK preserves the original command’s exit code for CI/CD compatibility
- No network access: RTK runs entirely locally, no data sent to external services
- Open source: All code is available at https://github.com/rtk-ai/rtk for review
- Backup system: Hook installation creates automatic backups (
settings.json.bak)
- Only rewrites known commands to their rtk equivalents
- Never modifies heredocs or scripts
- Passes through unrecognized commands unchanged
Does RTK modify my commands?
Does RTK modify my commands?
No. RTK never modifies the commands themselves - it only filters the output.When you run
rtk git status, RTK:- Executes the exact
git statuscommand - Captures the output
- Filters the output before displaying it
git status → rtk git status) before execution, but the underlying git command remains unchanged.All git operations (add, commit, push, etc.) are executed exactly as you specified - RTK just makes the output more concise.Performance
Why does <10ms startup time matter?
Why does <10ms startup time matter?
Claude Code users expect CLI tools to be instant. Any perceptible delay (>10ms) breaks the developer flow and creates a poor user experience.RTK achieves <10ms startup through:
- Zero async overhead: Single-threaded, no tokio runtime
- Lazy regex compilation: Compile once with
lazy_static!, reuse forever - Minimal allocations: Borrow over clone, in-place filtering
- No config I/O: Zero file reads on startup (config loaded on-demand)
You can benchmark RTK yourself:
hyperfine 'rtk git status' 'git status'What's the performance impact of using RTK?
What's the performance impact of using RTK?
Negligible. RTK adds <10ms overhead per command:
The token savings far outweigh the minimal performance cost. For example:
| Metric | Target | Typical |
|---|---|---|
| Startup time | <10ms | ~5ms |
| Memory overhead | <5MB | ~2MB |
| Token savings | 60-90% | ~70% |
- Running
git logwithout RTK: 0ms overhead, but costs 500 tokens - Running
rtk git log: +5ms overhead, but costs only 100 tokens (80% savings)
- Faster LLM responses (less data to process)
- Lower API costs
- Better context management
Hook Modes
What's the difference between hook modes?
What's the difference between hook modes?
RTK offers two hook patterns:
Recommendation: Use auto-rewrite hook for maximum savings. Use suggest hook only if you want to audit Claude’s command choices or prefer explicit control.
| Aspect | Auto-Rewrite Hook | Suggest Hook |
|---|---|---|
| Strategy | Intercepts and modifies command before execution | Emits system reminder when rtk-compatible command detected |
| Effect | Claude never sees the original command | Claude receives hint to use rtk, decides autonomously |
| Adoption | 100% (forced) | ~70-85% (depends on Claude’s adherence) |
| Use Case | Production workflows, guaranteed savings | Learning mode, auditing, explicit control |
| Overhead | Zero (transparent rewrite) | Minimal (reminder message in context) |
How do I switch between hook modes?
How do I switch between hook modes?
To use auto-rewrite hook (recommended):To use suggest hook:
Only one hook can be active at a time. Choose the one that fits your workflow.
Installation & Setup
What's the difference between global and local installation?
What's the difference between global and local installation?
RTK offers multiple installation scopes:
Recommendation: Use
| Command | Scope | Hook | RTK.md | CLAUDE.md | Tokens in Context | Use Case |
|---|---|---|---|---|---|---|
rtk init -g | Global | ✅ | ✅ (10 lines) | @RTK.md | ~10 | Recommended: All projects, automatic |
rtk init -g --claude-md | Global | ❌ | ❌ | Full (137 lines) | ~2000 | Legacy compatibility |
rtk init | Local | ❌ | ❌ | Full (137 lines) | ~2000 | Single project, no hook |
rtk init -g for global hook-first installation. This gives you:- Automatic command rewriting across all projects
- Minimal context overhead (~10 tokens vs ~2000 tokens)
- No need to remember to use rtk prefix
Do I need to restart Claude Code after installation?
Do I need to restart Claude Code after installation?
Yes. Settings changes require a full restart of Claude Code to take effect.After running
rtk init -g:- Close all Claude Code windows
- Restart Claude Code
- Test with
git statusto verify hook is working
Token Tracking
How accurate is RTK's token calculation?
How accurate is RTK's token calculation?
RTK uses character-based estimation for token counts:
- Input tokens: Character count of raw command output ÷ 4
- Output tokens: Character count of filtered output ÷ 4
- Savings: (input - output) / input × 100%
- Fast (no external API calls)
- Consistent (reproducible results)
- Good enough for analytics and trend tracking
For precise tokenization, LLMs would need to use their actual tokenizer (e.g., Claude’s tokenizer), but this would add network latency and API costs. The character-based estimate is a practical compromise.
Where is my token data stored?
Where is my token data stored?
RTK stores tracking data in a local SQLite database:Default location: Config file (The database includes:
~/.local/share/rtk/history.dbYou can customize this location:Environment variable (highest priority):~/.config/rtk/config.toml):- Command executed
- Input/output token counts
- Savings percentage
- Execution time
- Timestamp
Cross-Platform Support
Does RTK work on Windows?
Does RTK work on Windows?
Yes. RTK supports Windows, macOS, and Linux.Installation on Windows:
- Download pre-built binary from releases
- Or build from source:
cargo install --git https://github.com/rtk-ai/rtk
- Git Bash (comes with Git for Windows)
- WSL (Windows Subsystem for Linux)
- PowerShell (with some limitations)
Which shells does RTK support?
Which shells does RTK support?
RTK works with all POSIX-compliant shells:
- ✅ bash
- ✅ zsh
- ✅ fish
- ✅ sh
Still Have Questions?
Join the community:- GitHub Issues: https://github.com/rtk-ai/rtk/issues
- Email: [email protected]
- Website: https://www.rtk-ai.app
