Skip to main content

Installation

Pre-Installation Check RequiredAlways verify if RTK is already installed before proceeding:
If rtk gain works, you already have the correct RTK. Skip to Project Initialization.

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

This installs RTK to ~/.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)

Name Collision on crates.iocargo install rtk from crates.io might install the wrong package (Rust Type Kit instead of Token Killer).Always install from the GitHub repository or verify with rtk gain after installation.
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.gz

macOS Apple Silicon

rtk-aarch64-apple-darwin.tar.gz

Linux x86_64

rtk-x86_64-unknown-linux-gnu.tar.gz

Linux ARM64

rtk-aarch64-unknown-linux-gnu.tar.gz

Windows x86_64

rtk-x86_64-pc-windows-msvc.zip
1

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: 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.md reference to ~/.claude/CLAUDE.md
  • Prompts: “Patch settings.json? [y/N]”
2

Answer the prompt

This registers the hook in Claude Code’s configuration file.
3

Verify installation

Should show:
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 after rtk init --global Solution:
1

Verify hook is registered

2

Check settings.json

Should contain:
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 .deb from releases
  • For RPM-based distros (Fedora, RHEL): Download .rpm from releases
  • Ensure ~/.local/bin is 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