Rtk optimizer

From FlorianBruniaux/claude-code-plugins · View interactive version

Rtk optimizer is an AI agent skill from the GitHub repository FlorianBruniaux/claude-code-plugins. Wrap high-verbosity shell commands with RTK to reduce token consumption. Use when running git log, git diff, cargo test, pytest, or other verbose CLI output that wastes context window tokens.

How to use this skill

Skill file

RTK optimizer skill

Purpose: Automatically suggest RTK wrappers for high-verbosity commands to reduce token consumption.

How it works

  1. Detect high-verbosity commands in user requests
  2. Suggest RTK wrapper if applicable
  3. Execute with RTK when user confirms
  4. Track savings over session

Supported commands

Git (>70% reduction)

Medium-Value (50-70% reduction)

JS/TS Stack (70-90% reduction)

Rust Toolchain (80-90% reduction)

Python & Go (90% reduction)

GitHub CLI (79-87% reduction)

File operations

Activation examples

User: "Show me the git history"

Skill: Detects git log → Suggests rtk git log → Explains 92.3% token savings

User: "Find all markdown files"

Skill: Detects find → Suggests rtk find "*.md" . → Explains 76.3% savings

Installation check

Before first use, verify RTK is installed:

rtk --version  # Should output: rtk 0.16.0+

If not installed:

# Homebrew (macOS/Linux)
brew install rtk-ai/tap/rtk

# Cargo (all platforms)
cargo install rtk

Usage pattern

# When user requests high-verbosity command:

1. Acknowledge request
2. Suggest RTK optimization:
   "I'll use `rtk git log` to reduce token usage by ~92%"
3. Execute RTK command
4. Track savings (optional):
   "Saved ~13K tokens (baseline: 14K, RTK: 1K)"

Session tracking

Optional: Track cumulative savings across session:

# At session end
rtk gain  # Shows total token savings for session (SQLite-backed)

Edge cases

Configuration

Enable via CLAUDE.md:

## Token Optimization

Use RTK (Rust Token Killer) for high-verbosity commands:
- git operations (log, status, diff)
- package managers (pnpm, npm)
- build tools (cargo, go)
- test frameworks (vitest, pytest)
- file finding and reading

Metrics (verified)

Based on real-world testing:

Average: 72.6% token reduction

Limitations

Recommendation

Use RTK for: git workflows, file operations, test frameworks, build tools, package managers

Skip RTK for: small outputs, quick exploration, interactive commands

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.