v0.9.5 introduced a new hook-first installation mode that reduces context overhead from ~2000 tokens to ~10 tokens.
If you previously used rtk init -g with the old system (137-line injection):
# Simply re-run rtk init to automatically migratertk init -g# This will:# 1. Install the auto-rewrite hook to ~/.claude/hooks/rtk-rewrite.sh# 2. Create slim RTK.md (10 lines) at ~/.claude/RTK.md# 3. Add @RTK.md reference to ~/.claude/CLAUDE.md# 4. Prompt to patch settings.json# Restart Claude Code after migration
Benefits of migration:
99.5% reduction in context overhead (~2000 tokens → ~10 tokens)
Automatic command rewriting via hook
No changes to your workflow
Backward compatible with existing projects
Rollback if needed:
# Remove hook-first setuprtk init -g --uninstall# Return to legacy full injectionrtk init -g --claude-md
v0.8.0 introduced execution time tracking. Historical commands will show 0ms execution time.
Database Schema Update:RTK automatically migrates the SQLite schema when you run any rtk command after updating:
# Update RTKcargo install --git https://github.com/rtk-ai/rtk --force# Run any command to trigger migrationrtk gain# New fields are added:# - exec_time_ms (execution time in milliseconds)# - Historical data shows 0ms (pre-tracking)
New Features:
rtk gain now shows total and average execution time
--daily breakdown includes time metrics per day
JSON/CSV exports include total_time_ms and avg_time_ms fields
Migrating from v0.15.x to v0.16.0+ (Python & Go Support)
v0.15.0+ added Python (ruff, pytest, pip) and Go (test, build, vet, golangci-lint) support.
New Commands Available:
# Pythonrtk ruff check # Linter with JSON parsing (80% reduction)rtk ruff format # Formatter with text filterrtk pytest # Test runner with state machine (90% reduction)rtk pip list # Package manager (auto-detect uv, 70% reduction)# Gortk go test # NDJSON streaming parser (90% reduction)rtk go build # Build errors only (80% reduction)rtk go vet # Vet issues (75% reduction)rtk golangci-lint run # JSON grouped by rule (85% reduction)
Hook Auto-Rewrite:If you’re using the auto-rewrite hook, update it:
# Re-run init to update hook with new command patternsrtk init -g# Restart Claude Code
Current Setup: Full 137-line injection in ~/.claude/CLAUDE.mdMigration Steps:
# 1. Back up your current CLAUDE.mdcp ~/.claude/CLAUDE.md ~/.claude/CLAUDE.md.backup# 2. Install hook-first modertk init -g# 3. Verify hook installationrtk init --show# Should show: "✅ Hook: executable, with guards"# 4. Restart Claude Code# 5. Test with a commandgit status # Should automatically use rtk
What Changed:
~/.claude/CLAUDE.md now has just one line: @RTK.md
~/.claude/RTK.md created (10 lines, minimal context)
~/.claude/hooks/rtk-rewrite.sh installed
~/.claude/settings.json updated with hook registration
Current Setup: Using rtk prefix manually for each commandMigration Steps:
# Install hookrtk init -g# Restart Claude Code# Now you can drop the rtk prefix:# Old: rtk git status# New: git status (automatically rewrites to rtk git status)
v0.13.0+ supports custom database paths via environment variable or config file.
Migration Steps:
# 1. Stop any running rtk commands# 2. Move database to new locationmv ~/.local/share/rtk/history.db /path/to/custom.db# 3. Set new location (choose one method):# Method A: Environment variable (highest priority)echo 'export RTK_DB_PATH="/path/to/custom.db"' >> ~/.bashrcsource ~/.bashrc# Method B: Config filemkdir -p ~/.config/rtkcat > ~/.config/rtk/config.toml <<EOF[tracking]database_path = "/path/to/custom.db"EOF# 4. Verifyrtk gain # Should show your historical data
Problem: rtk init -g reports settings.json is invalid JSON.Solution:
# Validate JSONcat ~/.claude/settings.json | python3 -m json.tool# If invalid, restore from backupcp ~/.claude/settings.json.bak ~/.claude/settings.json# Retry migrationrtk init -g
Database migration failed
Problem: Error when running rtk gain after update.Solution:
# Back up databasecp ~/.local/share/rtk/history.db ~/.local/share/rtk/history.db.backup# Reset database (will lose history)rm ~/.local/share/rtk/history.db# Run rtk command to create fresh databasertk gain
Hook not working after migration
Problem: Hook installed but commands not using rtk.Solution:
# Verify hook installationrtk init --show# Check hook is executablels -la ~/.claude/hooks/rtk-rewrite.sh# Make executable if neededchmod +x ~/.claude/hooks/rtk-rewrite.sh# Restart Claude Code