Install
openclaw skills install rtk-token-saverUse rtk to reduce token usage from common shell, git, search, file-reading, test, build, and lint commands while preserving raw-output fallbacks when exact output is required.
openclaw skills install rtk-token-saverUse this skill when a task involves shell commands that may produce large output, especially repository inspection, git history, diffs, search, file reading, tests, linting, builds, logs, containers, or package manager output.
RTK is a CLI proxy that filters and compresses command output before it enters the agent context. Prefer RTK when compact output is enough to make the next decision. Use raw commands when exact bytes, full JSON, full logs, cryptographic material, or complete unmodified output is required.
Use RTK by default for:
Do not use RTK when:
Before relying on RTK, check whether it is available:
which rtk
rtk --version
rtk gain
If RTK is missing, do not install it silently. Report that RTK is unavailable and run the native command with the narrowest safe scope.
Prefer:
rtk ls .
rtk find "*.ts" .
rtk read path/to/file.ts
rtk read path/to/file.ts -l aggressive
rtk smart path/to/file.ts
Instead of broad raw commands such as:
ls -laR .
find . -type f
cat path/to/large-file.ts
Prefer:
rtk grep "pattern" .
rtk grep "functionName" src
Use native grep, ripgrep, or repository search tools when exact match behavior, line ranges, or complete output is required.
Prefer:
rtk git status
rtk git diff
rtk git diff --stat
rtk git log -n 10
rtk gh pr list
rtk gh pr view 42
Use raw git commands when applying patches, generating exact diffs for review, or feeding output into another tool.
Prefer RTK wrappers for high-noise checks:
rtk test npm test
rtk jest
rtk vitest
rtk pytest
rtk cargo test
rtk go test
rtk lint
rtk tsc
rtk next build
rtk cargo clippy
rtk ruff check
If a compact failure summary is not enough to fix the issue, rerun the smallest failing command natively with flags that show the exact failure.
Prefer:
rtk docker ps
rtk docker logs <container>
rtk docker compose ps
rtk kubectl pods
rtk kubectl logs <pod>
rtk aws logs get-log-events
rtk log path/to/app.log
Use raw output only when full logs are required for auditing, exact reproduction, or external attachment.
When RTK was used for important work, summarize: