Skip to main content

Quick Start

Get RTK up and running in under 5 minutes. This guide walks you through installation, verification, initialization, and your first token-optimized commands.

Prerequisites

  • macOS, Linux, or Windows
  • Command-line access
  • Claude Code, Cursor, or another AI coding assistant (optional but recommended)

Step 1: Install RTK

Choose your preferred installation method:
If you already have RTK installed, verify it’s the correct package:
If this command works (even if it says “No tracking data yet”), you’re good to go. Skip to Step 3.

Step 2: Verify Installation

Confirm RTK is installed correctly:
If rtk gain returns “command not found” but rtk --version works, you installed the wrong RTK (Rust Type Kit).Uninstall and reinstall the correct package:

Step 3: Initialize RTK

Set up RTK to work automatically with your AI coding assistant:
1

Run the init command

This installs a hook that automatically rewrites commands across all projects.
2

Answer the prompt

Type y and press Enter to register the hook with Claude Code.
3

Restart Claude Code

Close and reopen Claude Code for the hook to take effect.
What just happened?
  • Hook installed: ~/.claude/hooks/rtk-rewrite.sh now intercepts bash commands
  • Context optimized: ~/.claude/RTK.md added (only 10 lines, saves ~2000 tokens vs old method)
  • Settings patched: ~/.claude/settings.json now registers the hook
  • Backup created: Original settings saved to ~/.claude/settings.json.bak

Step 4: Test Your First Command

Try a few RTK commands to see the difference:

Directory Listing

Git Status

Git Push

Test Runner (Failures Only)

Step 5: View Your Savings

After running a few RTK commands, check your token savings:
First run? The rtk gain command will show “No tracking data yet” until you’ve run at least one RTK command.RTK tracks all usage in a local SQLite database at ~/.local/share/rtk/history.db.

What’s Next?

You’re now set up and saving tokens! Here are some next steps:

Explore Commands

See the full list of 50+ optimized commands for git, testing, linting, and more.

Hook Configuration

Learn how auto-rewrite hooks work and customize them for your workflow.

Analytics Deep Dive

Export token savings data as JSON/CSV for dashboards and reports.

Troubleshooting

Common issues and solutions for installation, hooks, and command failures.

Tips for Maximum Savings

1

Use hooks for automatic optimization

With rtk init --global, you never need to type rtk manually - all commands are rewritten automatically.
2

Prefix commands manually if hooks aren't installed

If you skipped the hook setup, manually prefix commands:
3

Check savings regularly

Run rtk gain weekly to see your cumulative savings and identify high-impact commands.
4

Report missing commands

If you find a command RTK doesn’t optimize, open an issue - we’re always adding more!

Common Workflows

Git Workflow

Test-Driven Development

Package Management

Container Operations

Getting Help

If you run into issues:

Documentation

Browse the full documentation for guides, references, and examples.

GitHub Issues

Report bugs, request features, or ask questions.

Troubleshooting

Fix common problems with installation, hooks, and commands.

Community

Join the RTK community and share your token savings!
Pro Tip: Run rtk gain --all --format json to export your savings data and create custom dashboards or CI/CD reports.