en un clic
add-rtk
// Install rtk token-compression proxy into agent containers. Routes Bash tool calls through rtk for 60–90% token savings on dev commands (git, cargo, pytest, docker, kubectl, etc.).
// Install rtk token-compression proxy into agent containers. Routes Bash tool calls through rtk for 60–90% token savings on dev commands (git, cargo, pytest, docker, kubectl, etc.).
Add iMessage channel integration via Chat SDK. Local (macOS) or remote (Photon API) mode.
Add Microsoft Teams channel integration via Chat SDK.
Format messages for WhatsApp, including mentions that render as real WhatsApp tags. Use when responding in a WhatsApp conversation (platform_id / chatJid ends with @s.whatsapp.net or @g.us).
Add WhatsApp channel via native Baileys adapter. Direct connection — no Chat SDK bridge. Uses QR code or pairing code for authentication.
Add Google Calendar as an MCP tool (list calendars, list/search/create events, free/busy queries) using OneCLI-managed OAuth. Multi-calendar and multi-account supported. Mirrors /add-gmail-tool's stub pattern — no raw credentials ever reach the container; OneCLI injects real tokens at request time.
Add Gmail as an MCP tool (read, search, send, label, draft) using OneCLI-managed OAuth. The agent gets Gmail tools in every enabled group; OneCLI injects real tokens at request time so no raw credentials are ever in the container or on disk in usable form.
| name | add-rtk |
| description | Install rtk token-compression proxy into agent containers. Routes Bash tool calls through rtk for 60–90% token savings on dev commands (git, cargo, pytest, docker, kubectl, etc.). |
Install rtk — a CLI proxy delivering 60–90% token savings on common dev commands (git, cargo, pytest, docker, kubectl, etc.) — and wire it transparently into agent containers via the Claude Code PreToolUse hook.
rtk binary at ~/.local/bin/rtk on the host~/.local/bin/rtk mounted read-only at /usr/local/bin/rtk inside the target agent group's containersPreToolUse hook in the agent group's settings.json so every Bash call is automatically filtered through rtk — no CLAUDE.md instructions neededcurl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
If the script put the binary elsewhere, move it:
find ~/.local ~/.cargo/bin ~/bin -name rtk 2>/dev/null
mv "$(which rtk 2>/dev/null)" ~/.local/bin/rtk
Verify:
~/.local/bin/rtk --version
chmod +x ~/.local/bin/rtk # if needed
ncl groups list
Note the group ID (e.g. ag-1776342942165-ptgddd). Repeat Steps 3–5 for each group.
additional_mounts is a JSON column not exposed via ncl config update. Update it directly via the DB helper, merging with any existing mounts.
Read current mounts first:
pnpm exec tsx scripts/q.ts data/v2.db \
"SELECT additional_mounts FROM container_configs WHERE agent_group_id = '<group-id>'"
Then write the merged array (include all existing entries plus the rtk entry):
pnpm exec tsx scripts/q.ts data/v2.db \
"UPDATE container_configs SET additional_mounts = '<merged-json>' WHERE agent_group_id = '<group-id>'"
The rtk entry to append: {"hostPath":"/home/<user>/.local/bin/rtk","containerPath":"/usr/local/bin/rtk","readonly":true}
Verify:
pnpm exec tsx scripts/q.ts data/v2.db \
"SELECT additional_mounts FROM container_configs WHERE agent_group_id = '<group-id>'"
Each agent group has a settings.json at:
data/v2-sessions/<group-id>/.claude-shared/settings.json
This file is mounted at /home/node/.claude/settings.json inside the container and is read by Claude Code for hooks, env, and model config.
Add the PreToolUse entry using jq to merge safely:
SETTINGS="data/v2-sessions/<group-id>/.claude-shared/settings.json"
jq '.hooks.PreToolUse = [{"matcher":"Bash","hooks":[{"type":"command","command":"rtk hook claude"}]}]' \
"$SETTINGS" > /tmp/rtk-settings.json && mv /tmp/rtk-settings.json "$SETTINGS"
If PreToolUse already exists, append instead of overwriting:
jq '.hooks.PreToolUse += [{"matcher":"Bash","hooks":[{"type":"command","command":"rtk hook claude"}]}]' \
"$SETTINGS" > /tmp/rtk-settings.json && mv /tmp/rtk-settings.json "$SETTINGS"
ncl groups restart --id <group-id>
No --message needed — the hook is transparent and requires no agent awareness.
Ask the agent to run git status or any other supported command. rtk intercepts it silently. Check savings with:
~/.local/bin/rtk gain
rtk: command not found inside the containerMount wasn't applied or container wasn't restarted:
pnpm exec tsx scripts/q.ts data/v2.db \
"SELECT additional_mounts FROM container_configs WHERE agent_group_id = '<group-id>'"
# Look for entry with /usr/local/bin/rtk
ncl groups restart --id <group-id>
Verify the hook is in settings.json:
jq '.hooks.PreToolUse' data/v2-sessions/<group-id>/.claude-shared/settings.json
If missing, re-run Step 4.
chmod +x ~/.local/bin/rtk