Install RTK (Rust Token Killer) and enforce settings so that OpenClaw agents automatically use RTK commands.
Background: The Claude Code plugin method (
openclaw plugins install) is not compatible with OpenClaw. In OpenClaw, you must put instructions in AGENTS.md to enforce this on agents.
Workflow
STEP 1: Check RTK binary installation
which rtk
- Installed → proceed to STEP 2
- Not installed →
brew install rtkrun. If brew is unavailable, install with curl:curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
After installation, check the version:
rtk --version
STEP 2: Create RTK.md
In the workspace root, RTK.md create the file. This file contains the RTK usage rules that agents will reference.
RTK.md Contents:
# RTK 사용 규칙 (필수)
이 워크스페이스의 모든 에이전트는 아래 규칙을 **반드시** 따라야 한다.
## 핵심 원칙
Bash 도구로 명령어를 실행할 때, 아래 표의 명령어는 반드시 `rtk` 접두어를 붙여 실행한다.
RTK는 출력을 압축하여 토큰 소비를 60-90% 줄인다.
## 필수 치환 표
| 기존 명령어 | RTK 명령어 |
|------------|-----------|
| `ls`, `tree` | `rtk ls` |
| `cat`, `head`, `tail` | `rtk read` |
| `grep`, `rg` | `rtk grep` |
| `find` | `rtk find` |
| `git status` | `rtk git status` |
| `git log` | `rtk git log` |
| `git diff` | `rtk git diff` |
| `git push` | `rtk git push` |
| `cargo build` | `rtk cargo build` |
| `cargo test` | `rtk test cargo test` |
| `npm run build` | `rtk err npm run build` |
| `npm test` | `rtk test npm test` |
| `docker ps` | `rtk docker ps` |
| `kubectl get pods` | `rtk kubectl pods` |
| `pip list` | `rtk pip list` |
| `pnpm list` | `rtk pnpm list` |
## 예외 (RTK를 쓰지 않는 경우)
- Claude Code 내장 도구 (Read, Grep, Glob) 사용 시 → RTK 불필요
- `cd`, `mkdir`, `rm`, `cp`, `mv` 등 출력이 없는 명령어
- 파이프(`|`)로 이미 필터링된 명령어
- 사용자가 명시적으로 원본 출력을 요청한 경우
## 토큰 절약 현황 확인
세션 종료 전 또는 요청 시:
```bash
rtk gain
### STEP 3: AGENTS.md에 RTK 강제 지침 삽입
워크스페이스의 `AGENTS.md` 파일에 아래 블록을 추가한다.
이미 RTK 관련 내용이 있으면 교체한다.
삽입할 블록:
```markdown
## RTK (Rust Token Killer) — 필수
**모든 에이전트는 Bash 명령어 실행 시 반드시 RTK를 사용해야 한다.**
상세 규칙은 `@RTK.md`를 참조하라. 이 규칙은 선택이 아니라 필수다.
요약:
- `ls` → `rtk ls`, `cat` → `rtk read`, `grep` → `rtk grep`
- `git status/log/diff/push` → `rtk git status/log/diff/push`
- 빌드/테스트 → `rtk test ...`, `rtk err ...`
- 내장 도구(Read, Grep, Glob)는 예외
**위반 시:** 토큰 낭비로 세션 비용이 불필요하게 증가한다.
STEP 4: Verification
- Verify RTK binary operation:
rtk ls .
- Verify RTK.md exists:
ls RTK.md
- Verify the RTK block exists in AGENTS.md:
grep -c "RTK" AGENTS.md
- Report results:
✅ RTK 설치 완료 (버전: X.X.X)
✅ RTK.md 생성 완료
✅ AGENTS.md에 RTK 강제 지침 삽입 완료
→ 이제 모든 에이전트가 RTK를 사용합니다.
Precautions
- RTK applies only to shell commands executed via the Bash tool. Claude Code built-in tools (Read, Grep, Glob, etc.) are unrelated to RTK.
rtk init -gYou can also install Claude Code hooks with , but since hooks do not work in the OpenClaw ACP environment, use the AGENTS.md instruction method.- RTK.md must be created per workspace. It is not a global setting.