add-rtk

Installs the rtk token-compression proxy into agent containers via mounts and PreToolUse hooks.

2|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/RADHA0-max/selfhealbackend --skill add-rtk-radha0-max
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-rtk
Source: https://github.com/RADHA0-max/selfhealbackend/tree/main/nanoclaw/.claude/skills/add-rtk
Command: npx skills add https://github.com/RADHA0-max/selfhealbackend --skill add-rtk-radha0-max

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agent containers running Claude Code consume large amounts of tokens on verbose dev command output (git, cargo, pytest, docker, kubectl). This Skill installs the rtk CLI proxy on the host and wires it into agent containers so every Bash tool call is automatically filtered through rtk, reducing token usage by 60–90% without changing agent instructions. ## Core Features & Use Cases - Host installation: Downloads the rtk binary to ~/.local/bin/rtk and verifies it is executable. - Container wiring: Adds a read-only mount entry to the container_configs database and registers a PreToolUse hook in each agent group's settings.json, idempotently (safe to re-run without duplicates). - Verification and troubleshooting: Includes commands to confirm the binary works inside the container, check hook registration, and measure savings with rtk gain. - Use Case: You operate multiple NanoClaw agent groups and want to cut token costs on dev workflows; run this Skill per group to route all Bash calls through rtk transparently. ## Quick Start Install rtk on the host and wire it into my agent group so all Bash commands are filtered through the rtk token-compression proxy.

Frequently Asked Questions about add-rtk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token usage from Bash commands in Claude Code agents?

Install the rtk CLI proxy on the host, mount it read-only into the agent container at /usr/local/bin/rtk, and register a PreToolUse hook running 'rtk hook claude' in settings.json. Every Bash call is then filtered through rtk automatically.

How do I add a PreToolUse hook to Claude Code settings.json?

Use jq to append an entry with matcher 'Bash' and a command hook to the hooks.PreToolUse array in the group's settings.json. The provided jq command first removes any existing rtk hook, so re-running it never creates duplicates.

Which commands does rtk compress for token savings?

rtk targets common dev commands such as git, cargo, pytest, docker, and kubectl, delivering 60–90% token savings on their output. You can measure actual savings with the 'rtk gain' command on the host.

Why is rtk not found inside the container after setup?

The mount was not applied or the container was not restarted. Check the additional_mounts column in container_configs for an entry with containerPath /usr/local/bin/rtk, then restart the group with 'ncl groups restart --id <group-id>'.

How do I remove rtk from an agent group?

Follow REMOVE.md: delete the rtk mount entry from container_configs, remove the rtk PreToolUse hook from settings.json with jq, restart the container, and optionally delete the host binary at ~/.local/bin/rtk. The process is idempotent.