setup-rtk

setup-rtk is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 9 tokens per session (1,502 once invoked), scanned A, original, MIT.

A setup command for RTK, a tool that shortens command output to reduce the amount of text Claude Code must process. It checks whether RTK is installed and reviews its configuration.

In plain words
What is it for?
Use it to check RTK installation, inspect reported savings, enable ultra-compact output in its hook, and review output limits.
Why use it?
It helps reduce unnecessary terminal output and points out configuration changes that can make coding sessions use fewer tokens.

Command for Claude Code

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/thebeardedbearsas/claude-craft/setup-rtk
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-rtk

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/setup-rtk.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/setup-rtk)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/setup-rtk"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/setup-rtk.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,502 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.01502
Opus 5 $0.00005 $0.00751
Sonnet 5 $0.00002 $0.00300
Haiku 4.5 $0.00001 $0.00150

Measured 5d ago against content hash c662b65d03ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-rtk scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

echo "Install options (the curl|bash pattern is BLOCKED by Claude Craft hooks):"
.claude/commands/common/setup-rtk.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Token Optimization Setup

Configure RTK (Rust Token Killer) and comprehensive token optimization for Claude Code sessions.

Steps

1. Check RTK Installation

# Check if RTK is installed
if command -v rtk &>/dev/null; then
  echo "RTK installed: $(rtk --version)"
  echo ""
  rtk gain 2>/dev/null || echo "No savings data yet"
else
  echo "RTK is NOT installed"
  echo ""
  echo "Install options (the curl|bash pattern is BLOCKED by Claude Craft hooks):"
  echo "  1. (Recommended) make install-rtk    # from claude-craft root"
  echo "  2. cargo install rtk-cli            # if you have Rust toolchain"
  echo "  3. Download release binary manually: https://github.com/rtk-ai/rtk/releases"
fi

2. Configure RTK Optimizations

If RTK is installed, apply these optimizations:

a) Enable ultra-compact mode

Check the hook at ~/.claude/hooks/rtk-rewrite.sh. The rewrite command should use --ultra-compact:

REWRITTEN=$(rtk rewrite --ultra-compact "$CMD" 2>/dev/null)

If it doesn't have --ultra-compact, update the hook file.

b) Optimize RTK limits

Check ~/.config/rtk/config.toml and recommend these limits:

[limits]
grep_max_results = 100
grep_max_per_file = 10
status_max_files = 10
status_max_untracked = 5
passthrough_max_chars = 1500
c) Add custom filters

Check ~/.config/rtk/filters.toml. If it only contains template comments, suggest filters based on the detected project stack:

  • Docker projects: Add docker exec, compose, logs filters
  • Node.js projects: Add npm/npx install filters
  • PHP projects: Add composer filters
  • Python projects: Add pip install filters

3. Configure Sub-Agent Model and Forked Subagents

Check if both env vars are set:

echo "CLAUDE_CODE_SUBAGENT_MODEL=${CLAUDE_CODE_SUBAGENT_MODEL:-NOT SET}"
echo "CLAUDE_CODE_FORK_SUBAGENT=${CLAUDE_CODE_FORK_SUBAGENT:-NOT SET}"

If not set, recommend adding to ~/.bashrc (or ~/.zshrc):

# Use Sonnet 5 for sub-agents (exploration, grep, file reading) instead of Opus
# → 40-60% cost reduction on sub-agent invocations
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-5"

# Run sub-agents in isolated contexts (Claude Code 2.1.117+, see COMPATIBILITY.md)
# → Avoids polluting the main context window with sub-agent intermediate state
# → Compounds with context: fork on skills (~8-15K tokens saved per long session)
export CLAUDE_CODE_FORK_SUBAGENT=1

# Enable 1-hour prompt cache TTL (Claude Code 2.1.108+)
# → -40% cost on repetitive sessions (BMAD sprints, /team:* loops)
# → Same prompt cache key is reused for up to 1h instead of 5min default
export ENABLE_PROMPT_CACHING_1H=1

# Force 5-minute cache writes on every turn (Claude Code 2.1.108+)
# → Useful for short-burst dev loops that hit the cache repeatedly
# → Trade-off: small write overhead, large hit-rate gains on iterative work
export FORCE_PROMPT_CACHING_5M=1

Read the full file on GitHub · 150 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 150 lines · 9 tokens per session scan A c662b65d03ae

Subscribe to this mod's changes

setup-rtk is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 2d ago), licensed MIT. It adds 9 tokens to every session and 1,502 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.