Install
openclaw skills install rtkRTK (Rust Token Kit) - CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Use rtk to wrap commands like git, ls, cat, grep, test runners, linters, docker, kubectl, and more. Single Rust binary, zero dependencies, minimal overhead. Always prefer rtk wrappers when available for shell commands that produce verbose output.
openclaw skills install rtkRTK filters and compresses command outputs before they reach context. Use it to reduce token consumption by 60-90% on common dev operations.
Core principle: Prefix supported commands with rtk for compressed output.
# Git operations (80-92% savings)
rtk git status
rtk git diff
rtk git log -n 10
rtk git add .
rtk git commit -m "msg"
rtk git push
# File operations
rtk ls . # Token-optimized tree
rtk read file.rs # Smart file reading
rtk grep "pattern" .
# Testing (90% savings on failures)
rtk test cargo test
rtk test npm test
rtk vitest run
rtk playwright test
rtk pytest
rtk go test
# Linting (80-85% savings)
rtk lint # ESLint grouped by rule
rtk tsc # TypeScript errors by file
rtk cargo clippy
rtk ruff check
rtk golangci-lint run
# Build tools (75-80% savings)
rtk cargo build
rtk next build
rtk pnpm list
# Container ops (80% savings)
rtk docker ps
rtk docker logs <container>
rtk kubectl get pods
rtk kubectl logs <pod>
Use rtk for:
Skip rtk for:
git - status, diff, log, add, commit, push, pullgh - pr list/view, issue list, run listls - directory listingcat/head/tail - file reading (rewritten to rtk read)rg/grep - search (rewritten to rtk grep)find - file searchcargo test, npm test, vitest, jest, playwright, pytest, go testeslint, biome, tsc, prettier, ruff, golangci-lint, cargo clippycargo build, next build, prisma generatepnpm list, pip list, npm listdocker ps/images/logs, docker compose pskubectl get/logscurl - auto-detects JSONwget - strips progress barsdocker logs, kubectl logs - deduplicates repeated linesRTK applies four strategies per command type:
rtk read file.rs # Default: smart filtering
rtk read file.rs -l aggressive # Signatures only (strips bodies)
rtk smart file.rs # 2-line heuristic summary
When a command fails, RTK saves the full unfiltered output:
FAILED: 2/15 tests
[full output: ~/.local/share/rtk/tee/1707753600_cargo_test.log]
Read the tee log file if you need the complete unfiltered output.
# Standard ls -la (45 lines, ~800 tokens)
drwxr-xr-x 15 user staff 480 ... my-project/
-rw-r--r-- 1 user staff 1234 ...
...
# rtk ls (12 lines, ~150 tokens)
+-- src/ (8 files)
| +-- main.rs
+-- Cargo.toml
# Standard git push (15 lines, ~200 tokens)
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
...
# rtk git push (1 line, ~10 tokens)
ok main
# Standard cargo test (200+ lines on failure)
running 15 tests
test utils::test_parse ... ok
...
# rtk test cargo test (~20 lines)
FAILED: 2/15 tests
test_edge_case: assertion failed
test_overflow: panic at utils.rs:18
RTK binary should already be installed. Verify:
rtk --version # Should show version
rtk gain # Show token savings stats
If not found, the binary needs to be installed in the container.
rtk -u git status # ASCII icons, inline format
rtk env -f AWS # Show only AWS env vars
rtk summary <long-command> # Heuristic summary for unknown commands
rtk proxy <command> # Track usage without filtering
RTK config file (if needed): ~/.config/rtk/config.toml
[tracking]
database_path = "/path/to/custom.db"
[hooks]
exclude_commands = ["curl", "playwright"] # Skip rewrite
[tee]
enabled = true # Save raw output on failure
mode = "failures" # "failures", "always", or "never"
max_files = 20 # Rotation limit
RTK supports auto-rewriting Bash commands via hooks (for Claude Code, OpenCode, Gemini CLI). This is optional and not required for manual usage.
If the hook is installed, commands like git status are automatically rewritten to rtk git status before execution.
Not applicable for this deployment - manual rtk prefixing is the expected pattern.
Check token savings:
rtk gain # Summary stats
rtk gain --graph # ASCII graph (last 30 days)
rtk gain --history # Recent command history
rtk gain --daily # Day-by-day breakdown
"rtk: command not found"
which rtkOutput still verbose
rtk proxy <command> to track unsupported commandsNeed full output