Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rtk-ai/rtk/llms.txt
Use this file to discover all available pages before exploring further.
What is Proxy Mode?
Proxy mode executes commands without RTK filtering while still recording usage metrics in the tracking database. It provides a safety valve when RTK’s filtering causes issues or you need the full, unfiltered output.Proxy mode runs the raw command and passes through output unchanged. Token savings are 0%, but execution metrics (command count, timing) are still tracked.
Usage
Benefits
1. Bypass RTK Filtering Bugs
If RTK’s filter produces incorrect output:2. Track Metrics Without Filtering
Record which commands you use without modifying output:3. Guaranteed Compatibility
Proxy mode works with any command, even if RTK doesn’t implement a filter for it:4. Debugging & Comparison
Compare RTK-filtered vs raw output:Tracking Behavior
Proxy mode tracks commands with 0% savings:When to Use Proxy Mode
Use Proxy Mode When:
✅ RTK filter produces incorrect outputDon’t Use Proxy Mode When:
❌ You want token savings — Use regular RTK commands insteadExamples
Example 1: Debug RTK Filter
Example 2: Full Test Output for Debugging
Example 3: Unsupported Command
Example 4: Track Usage Without Filtering
Example 5: Compare Filtered vs Raw
Comparison with Regular RTK Commands
| Aspect | Regular RTK | Proxy Mode |
|---|---|---|
| Filtering | ✅ Smart filtering (60-90% reduction) | ❌ No filtering (raw output) |
| Token Savings | ✅ 60-90% | ❌ 0% |
| Tracking | ✅ Recorded with savings | ✅ Recorded with 0% savings |
| Compatibility | ⚠️ Only supported commands | ✅ Any command |
| Use Case | Production workflows | Debugging, unsupported commands |
| Exit Codes | ✅ Preserved | ✅ Preserved |
| Output | Compressed | Unchanged |
Implementation Details
How Proxy Mode Works Internally
How Proxy Mode Works Internally
From RTK’s architecture:Tracking records:
- Command parsing:
rtk proxy <command>is parsed by Clap - Execution: RTK executes
<command>directly viastd::process::Command - Output passthrough: stdout/stderr are passed unchanged to the terminal
- Tracking: Input and output tokens are the same (estimated from raw output)
- Exit code: Preserved from the underlying command
original_cmd=<command> <args>rtk_cmd=rtk proxy <command> <args>input_tokens=output_tokens(no filtering)saved_tokens= 0savings_pct= 0.0
Troubleshooting
Proxy Mode Not Tracking
Symptom:rtk proxy <command> runs but doesn’t appear in rtk gain --history.
Solution: Check database path and permissions.
Exit Code Not Preserved
Symptom:rtk proxy <command> always exits with 0, even on failure.
Solution: This is a bug. Report at github.com/rtk-ai/rtk/issues.
Workaround:
Command Not Found
Symptom:rtk proxy terraform plan → “terraform: command not found”
Solution: Proxy mode requires the underlying command to be in PATH.
See Also
- Tee Recovery — Full output recovery on command failures
- Custom Database Path — Configure tracking database location
