plugins/rtk/skills/rtk-optimization/SKILL.md
RTK (Rust Token Killer) reduces LLM token consumption by 60-90% by filtering and compressing command outputs. Use when user asks about token savings, token optimization, RTK usage, `rtk gain`, `rtk discover`, or `rtk proxy`. Triggers on mentions of token reduction, RTK commands, or checking command cost.
npx skillsauth add pleaseai/claude-code-plugins RTK Token OptimizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
RTK is a high-performance CLI proxy written in Rust. It intercepts commands like git status, npm install, etc., and rewrites their output to be dramatically more token-efficient.
rtk gain # Show token savings analytics
rtk gain --history # Show command usage history with savings
rtk discover # Analyze Claude Code history for missed opportunities
rtk proxy <cmd> # Execute raw command without filtering (for debugging)
rtk <command> [args...]
# Example: rtk git status
# Example: rtk npm test
# Quick install (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
# macOS/Linux via Homebrew
brew install rtk-ai/tap/rtk
# Or via cargo (use the explicit Git URL — plain `cargo install rtk`
# may install the wrong package due to a name collision)
cargo install --git https://github.com/rtk-ai/rtk rtk
rtk --version # Should show: rtk X.Y.Z
rtk gain # Should work (not "command not found")
which rtk # Verify correct binary
⚠️ Name collision: If rtk gain fails, you may have reachingforthejack/rtk (Rust Type Kit) installed instead.
This plugin already installs the Claude Code hook — no rtk init needed.
rtk init --global patches ~/.claude/settings.json with a rtk hook claude PreToolUse entry — the non-plugin alternative to this plugin. Don't combine them: the hook would fire twice (redundant, not harmful).rtk init (per-project) installs no hook — it only injects RTK instructions into the project CLAUDE.md and creates a .rtk/filters.toml filter template.When installed as a Claude Code plugin, RTK's PreToolUse hook intercepts every Bash tool call and rewrites commands through rtk rewrite before execution. This is transparent to Claude — commands run normally but produce compressed, token-efficient output. All rewrite and permission logic lives in the rtk rewrite binary (deny rules pass through to Claude Code's native handling; ask rules rewrite but still prompt the user).
Config file: ~/.config/rtk/config.toml (Linux) or ~/Library/Application Support/rtk/config.toml (macOS). View with rtk config, create with rtk config --create.
# Exclude commands from auto-rewriting (prefix, subcommand, or ^regex)
[hooks]
exclude_commands = ["git rebase", "docker exec"]
RTK_DISABLED=1 <command> — disable RTK for a single invocationRTK_HOOK_AUDIT=1 — enable hook audit logging.rtk/filters.toml in the project rootjq (for JSON parsing in the hook script)| Command | Raw tokens | RTK tokens | Savings |
|---------|-----------|------------|---------|
| git status | ~800 | ~50 | 94% |
| npm install | ~2000 | ~200 | 90% |
| ls -la | ~400 | ~80 | 80% |
tools
Creates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow sdk", "queue", "event", "push", "subscribe", or step-based orchestration.
tools
Install and configure Vercel Workflow SDK before it exists in node_modules. Use when the user asks to "install workflow", "set up workflow", "add durable workflows", "configure workflow sdk", or "init workflow" for Next.js, Express, Hono, Fastify, NestJS, Nitro, Nuxt, Astro, SvelteKit, or Vite.
tools
Migrates Temporal, Inngest, Trigger.dev, and AWS Step Functions workflows to the Workflow SDK. Use when porting Activities, Workers, Signals, step.run(), step.waitForEvent(), Trigger.dev tasks / wait.forToken / triggerAndWait, ASL JSON state machines, Task/Choice/Wait/Parallel states, task tokens, or child workflows.
tools
Use when building UIs leveraging the WordPress Design System (WPDS) and its components, tokens, patterns, etc.