Troubleshooting
Troubleshooting
Section titled “Troubleshooting”rtk gain says “not a rtk command”
Section titled “rtk gain says “not a rtk command””Symptom:
$ rtk gainrtk: 'gain' is not a rtk command. See 'rtk --help'.Cause: You installed Rust Type Kit (reachingforthejack/rtk) instead of Rust Token Killer (rtk-ai/rtk). They share the same binary name.
Fix:
cargo uninstall rtkcurl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | shrtk gain # should now show token savings statsHow to tell which rtk you have
Section titled “How to tell which rtk you have”If rtk gain… | You have |
|---|---|
| Shows token savings dashboard | Rust Token Killer ✅ |
| Returns “not a rtk command” | Rust Type Kit ❌ |
AI assistant not using RTK
Section titled “AI assistant not using RTK”Symptom: Claude Code (or another agent) runs cargo test instead of rtk cargo test.
Checklist:
-
Verify RTK is installed:
Terminal window rtk --versionrtk gain -
Initialize the hook:
Terminal window rtk init --global # Claude Codertk init --global --cursor # Cursorrtk init --global --opencode # OpenCode -
Restart your AI assistant.
-
Verify hook status:
Terminal window rtk init --show -
Check
settings.jsonhas the hook registered (Claude Code):Terminal window cat ~/.claude/settings.json | grep rtk
RTK not found after cargo install
Section titled “RTK not found after cargo install”Symptom:
$ rtk --versionzsh: command not found: rtkCause: ~/.cargo/bin is not in your PATH.
Fix:
For bash (~/.bashrc) or zsh (~/.zshrc):
export PATH="$HOME/.cargo/bin:$PATH"For fish (~/.config/fish/config.fish):
set -gx PATH $HOME/.cargo/bin $PATHThen reload:
source ~/.zshrc # or ~/.bashrcrtk --versionRTK on Windows
Section titled “RTK on Windows”Double-clicking rtk.exe does nothing
Section titled “Double-clicking rtk.exe does nothing”Symptom: You double-click rtk.exe, a terminal flashes and closes instantly.
Cause: RTK is a command-line tool. With no arguments, it prints usage and exits. The console window opens and closes before you can read anything.
Fix: Open a terminal first, then run RTK from there:
- Press
Win+R, typecmd, press Enter - Or open PowerShell or Windows Terminal
- Then run:
rtk --version
Hook not working (no auto-rewrite)
Section titled “Hook not working (no auto-rewrite)”Symptom: rtk init -g shows “Falling back to —claude-md mode” on Windows.
Cause: The auto-rewrite hook (rtk-rewrite.sh) requires a Unix shell. Native Windows doesn’t have one.
Fix: Use WSL for full hook support:
# Inside WSLcurl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | shrtk init -g # full hook mode works in WSLOn native Windows, RTK falls back to CLAUDE.md injection. Your AI assistant gets RTK instructions but won’t auto-rewrite commands. It can still use RTK manually: rtk cargo test, rtk git status, etc.
Node.js tools not found
Section titled “Node.js tools not found”Symptom:
rtk vitest --runError: program not foundCause: On Windows, Node.js tools are installed as .CMD/.BAT wrappers. Older RTK versions couldn’t find them.
Fix: Update to RTK v0.23.1+:
cargo install --git https://github.com/rtk-ai/rtkrtk --version # should be 0.23.1+Compilation error during installation
Section titled “Compilation error during installation”rustup update stablerustup default stablecargo cleancargo build --releasecargo install --path . --forceMinimum required Rust version: 1.70+.
OpenCode not using RTK
Section titled “OpenCode not using RTK”rtk init --global --opencode# restart OpenCodertk init --show # should show "OpenCode: plugin installed"cargo install rtk installs the wrong package
Section titled “cargo install rtk installs the wrong package”If Rust Type Kit is published to crates.io under the name rtk, cargo install rtk may install the wrong one.
Always use the explicit URL:
cargo install --git https://github.com/rtk-ai/rtkRun the diagnostic script
Section titled “Run the diagnostic script”From the RTK repository root:
bash scripts/check-installation.shChecks:
- RTK installed and in PATH
- Correct version (Token Killer, not Type Kit)
- Available features
- Claude Code integration
- Hook status
Still stuck?
Section titled “Still stuck?”Open an issue: https://github.com/rtk-ai/rtk/issues