| title | Quick Start | ||
|---|---|---|---|
| description | Get RTK running in 5 minutes and see your first token savings | ||
| sidebar |
|
This guide walks you through your first RTK commands after installation.
RTK is installed and verified:
rtk --version # rtk x.y.z
rtk gain # shows token savings dashboardIf not, see Installation.
# For Claude Code (global — applies to all projects)
rtk init --global
# For a single project only (CLAUDE.md instructions, no hook)
cd /your/project && rtk initrtk init --global installs the hook that automatically rewrites commands. Restart your AI assistant after this step.
Using something other than Claude Code? Every agent has its own flag:
rtk init -g --gemini # Gemini CLI
rtk init -g --codex # Codex (OpenAI)
rtk init -g --agent cursor # Cursor
rtk init -g --agent windsurf # Windsurf
rtk init --agent cline # Cline / Roo CodeSee Supported agents for the full list, including per-agent uninstall and the project-local vs global distinction.
To see exactly what init would change before it touches anything, add --dry-run:
rtk init --global --dry-runEvery would-be file create/update/patch is printed with a [dry-run] would ... prefix, then a [dry-run] Nothing written. footer. Nothing on disk is modified, no settings.json is patched, and the telemetry consent prompt is skipped. Combine with -v to also print the full content RTK would write:
rtk init --global --dry-run -v--dry-run works for every init flavour (--agent cursor, --gemini, --codex, --copilot, --uninstall, ...). It cannot be combined with --show.
Once the hook is installed, nothing changes in how you work. Your AI assistant runs commands as usual — the hook intercepts them transparently and rewrites them before execution.
For example, when Claude Code runs cargo test, the hook rewrites it to rtk cargo test before it executes. The LLM receives filtered output with only the failures — not 500 lines of passing tests. You never see or type rtk.
RTK covers all major ecosystems — Git, Cargo/Rust, JavaScript, Python, Go, Ruby, .NET, Docker/Kubernetes, and more. See What RTK Optimizes for the full list.
After a few commands, see how much was saved:
rtk gainIllustrative output:
Total commands : 10
Input tokens : 50,000
Output tokens : 5,000
Saved : 45,000 (90.0%)
:::caution[The hook only fires on Bash tool calls]
Built-in agent tools like Read, Grep and Glob do not pass through the Bash hook, so they are not auto-rewritten. To get RTK's compact output for those workflows, either use shell commands (cat/head/tail, rg/grep, find) or call rtk read, rtk grep and rtk find directly.
The full edition can additionally compress an agent's own Read and MCP tool output through the PostToolUse hook — see Pipelines.
:::
Simple quoted shell wrappers are rewritten too, without changing the shell they name:
bash -c "head foo && grep -R bar ."
# → bash -c "rtk read foo --head-lines 10 && rtk grep -R bar ."This covers exact sh -c, bash -c, zsh -c and fish -c wrappers around a quoted script. A fish -c script is read as fish, so fish's own syntax ((cmd) substitution, and/or/end) is left alone rather than rewritten under POSIX rules:
fish -c 'git status; cargo test' # → fish -c 'rtk git status; rtk cargo test'
fish -c 'git status; and cargo test' # unchangedShell expansion inside an outer double quote, extra shell options, redirects to files and nested wrappers pass through unchanged.
Commands RTK doesn't recognize run through passthrough — output is unchanged, usage is tracked:
rtk bypass make install- What RTK Optimizes — all supported commands and savings by ecosystem
- Supported agents — Claude Code, Cursor, Copilot, and more
- Configuration — customize RTK behavior
- Token Savings Analytics — the full
rtk gainsurface - Editions and Licensing — what each download contains