Installation
Installation Methods
Choose the method that works best for your platform:Homebrew
Recommended for macOS/LinuxEasiest installation method with automatic updates.
Quick Install Script
Fast one-liner for Linux/macOSDownloads and installs to
~/.local/bin.Cargo
For Rust developersBuild from source or install from crates.io.
Pre-built Binaries
Manual installationDownload compiled binaries for all platforms.
Homebrew (macOS/Linux)
1
Install via Homebrew
2
Verify installation
If
rtk gain shows token savings stats OR says “No tracking data yet”, you have the correct RTK installed.If you get “command not found”, you have the wrong package.Quick Install Script (Linux/macOS)
1
Run the install script
~/.local/bin/rtk by default.2
Add to PATH if needed
If
rtk --version fails after installation, add ~/.local/bin to your PATH:bash
zsh
3
Verify installation
Cargo (from source)
1
Install Rust toolchain (if needed)
2
Install RTK
3
Verify installation
Pre-built Binaries
Download pre-compiled binaries from GitHub Releases:macOS Intel
rtk-x86_64-apple-darwin.tar.gzmacOS Apple Silicon
rtk-aarch64-apple-darwin.tar.gzLinux x86_64
rtk-x86_64-unknown-linux-gnu.tar.gzLinux ARM64
rtk-aarch64-unknown-linux-gnu.tar.gzWindows x86_64
rtk-x86_64-pc-windows-msvc.zip1
Download the appropriate binary
macOS (Intel)
macOS (Apple Silicon)
Linux (x86_64)
2
Extract and install
3
Add to PATH (if needed)
Project Initialization
After installation, initialize RTK for your AI coding assistant:Global Setup (Recommended)
This installs a hook that automatically rewrites commands across all Claude Code projects:1
What happens during init
- Installs hook to
~/.claude/hooks/rtk-rewrite.sh - Creates
~/.claude/RTK.md(10 lines, minimal context) - Adds
@RTK.mdreference to~/.claude/CLAUDE.md - Prompts: “Patch settings.json? [y/N]”
2
Answer the prompt
3
Verify installation
4
Restart Claude Code
The hook only takes effect after restarting Claude Code.
What is settings.json?Claude Code’s configuration file (
~/.claude/settings.json) that registers hooks. The RTK hook transparently rewrites commands like git status → rtk git status before execution.RTK creates a backup at ~/.claude/settings.json.bak before making changes.Alternative: Non-Interactive Setup
Verification
Test that RTK is working correctly:Troubleshooting
Command Not Found
Problem:rtk: command not found after installation
Solution:
1
Check if rtk is in PATH
2
Add to PATH
bash
zsh
Wrong RTK Installed
Problem:rtk gain says “command not found” but rtk --version works
Solution: You installed Rust Type Kit instead of Token Killer
Hook Not Working
Problem: Commands still not using RTK afterrtk init --global
Solution:
1
Verify hook is registered
2
Check settings.json
3
Restart Claude Code
Hooks require a full restart to take effect.
Settings.json Patching Failed
Problem:rtk init --global fails to patch settings.json
Solution:
Platform-Specific Notes
macOS
- Homebrew is the recommended installation method
- Use Apple Silicon binary (
aarch64) on M1/M2/M3 Macs - First run may trigger Gatekeeper - allow in System Preferences → Security
Linux
- Quick install script works on all distros
- For DEB-based distros (Ubuntu, Debian): Download
.debfrom releases - For RPM-based distros (Fedora, RHEL): Download
.rpmfrom releases - Ensure
~/.local/binis in PATH
Windows
- Download Windows binary from releases
- Extract to a permanent location (e.g.,
C:\Program Files\rtk) - Add to PATH via System Properties → Environment Variables
- RTK has limited Windows testing - report issues on GitHub
Uninstalling
Complete Removal
Restore Settings.json
If something goes wrong:Next Steps
Quick Start Guide
Follow our 5-minute guide to start saving tokens immediately
