Claude Skill

RTK Optimizer Skill

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.

Reviewed community sourceInstallable8 sections3 related pages

Editor's Note

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. Covers how it works, supported commands, activation examples.

Editorial Guide

What to do with this skill

Start with the workflow below, then drop into the upstream source only after the page has narrowed the job for you.

What this skill does

Wrap high-verbosity shell commands with RTK to reduce token consumption.

When to use it

running git log, git diff, cargo test, pytest, or other verbose CLI output that wastes context window tokens.

Install and setup notes

  • Open the upstream source before treating this page as install-ready, because not every official record is meant to be dropped into a workflow unchanged.
  • Keep the context narrow. These skills are usually strongest when you load only the branch, reference set, or workflow step that matches the current task.
  • If you plan to standardize on this skill for team use, pin the upstream repo and check for updates periodically instead of assuming the official defaults are static.

Example workflow

  1. Start with a concrete task that clearly matches this skill's intended trigger: running git log, git diff, cargo test, pytest, or other verbose CLI output that wastes context window tokens.
  2. Read the overview and first source section, then choose the smallest branch of guidance or references that solves the task in front of you.
  3. Run the change on a real file, command, or workflow, verify the result, and only then widen the skill into a repeatable team pattern.

Compatible agents

This skill is explicitly marked for Claude Code.

Claude Code

Install source

This page does not expose a single copy-paste install command in the normalized record. Use the upstream install source below to confirm the exact steps, file paths, and current setup expectations before you add it to your stack.

Page Outline

How It WorksSupported CommandsActivation ExamplesInstallation CheckUsage PatternSession TrackingEdge CasesConfiguration

Source Content

Normalized top-level metadata comes from the directory layer. The body below is the upstream source content for this item.

RTK Optimizer Skill

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

How It Works

  • **Detect high-verbosity commands** in user requests
  • **Suggest RTK wrapper** if applicable
  • **Execute with RTK** when user confirms
  • **Track savings** over session

Supported Commands

Git (>70% reduction)

  • `git log` → `rtk git log` (92.3% reduction)
  • `git status` → `rtk git status` (76.0% reduction)
  • `find` → `rtk find` (76.3% reduction)

Medium-Value (50-70% reduction)

  • `git diff` → `rtk git diff` (55.9% reduction)
  • `cat <large-file>` → `rtk read <file>` (62.5% reduction)

JS/TS Stack (70-90% reduction)

  • `pnpm list` → `rtk pnpm list` (82% reduction)
  • `pnpm test` / `vitest run` → `rtk vitest run` (90% reduction)

Rust Toolchain (80-90% reduction)

  • `cargo test` → `rtk cargo test` (90% reduction)
  • `cargo build` → `rtk cargo build` (80% reduction)
  • `cargo clippy` → `rtk cargo clippy` (80% reduction)

Python & Go (90% reduction)

  • `pytest` → `rtk python pytest` (90% reduction)
  • `go test` → `rtk go test` (90% reduction)

GitHub CLI (79-87% reduction)

  • `gh pr view` → `rtk gh pr view` (87% reduction)
  • `gh pr checks` → `rtk gh pr checks` (79% reduction)

File Operations

  • `ls` → `rtk ls` (condensed output)
  • `grep` → `rtk grep` (filtered output)

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

  • **Small outputs** (<100 chars): Skip RTK (overhead not worth it)
  • **Already using Claude tools**: Grep/Read tools are already optimized
  • **Multiple commands**: Batch with RTK wrapper once, not per command

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:

  • `git log`: 13,994 chars → 1,076 chars (92.3% reduction)
  • `git status`: 100 chars → 24 chars (76.0% reduction)
  • `find`: 780 chars → 185 chars (76.3% reduction)
  • `git diff`: 15,815 chars → 6,982 chars (55.9% reduction)
  • `read file`: 163,587 chars → 61,339 chars (62.5% reduction)

**Average: 72.6% token reduction**

Limitations

  • 446 stars on GitHub, actively maintained (30 releases in 23 days)
  • Not suitable for interactive commands
  • Rapid development cadence (check for breaking changes)

Recommendation

**Use RTK for**: git workflows, file operations, test frameworks, build tools, package managers **Skip RTK for**: small outputs, quick exploration, interactive commands

References

  • RTK GitHub: https://github.com/rtk-ai/rtk
  • RTK Website: https://www.rtk-ai.app/

<!-- truncated -->

Recommended skills

Next places to browse

Sponsored
MoltAwards: Turn AI agents loose on government contracts & jobs! logo

Turn AI agents loose on government contracts

Learn more