rtk-optimizer

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.

3,046 stars

Best use case

rtk-optimizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using rtk-optimizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/rtk-optimizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/FlorianBruniaux/claude-code-ultimate-guide/main/examples/skills/rtk-optimizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/rtk-optimizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How rtk-optimizer Compares

Feature / Agentrtk-optimizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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)
- `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:
```bash
rtk --version  # Should output: rtk 0.16.0+
```

If not installed:
```bash
# Homebrew (macOS/Linux)
brew install rtk-ai/tap/rtk

# Cargo (all platforms)
cargo install rtk
```

## Usage Pattern

```markdown
# 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:

```bash
# 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:
```markdown
## 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/
- Evaluation: `docs/resource-evaluations/rtk-evaluation.md`
- CLAUDE.md template: `examples/claude-md/rtk-optimized.md`

Related Skills

voice-refine

3046
from FlorianBruniaux/claude-code-ultimate-guide

Transform verbose voice input into structured, token-efficient Claude prompts. Use when cleaning up voice memos, dictation output, or speech-to-text transcriptions that contain filler words, repetitions, and unstructured thoughts.

talk-stage6-revision

3046
from FlorianBruniaux/claude-code-ultimate-guide

Produces revision sheets with quick navigation by act, a master concept-to-URL table, Q&A cheat-sheet with 6-10 anticipated questions, glossary, and external resources list. Use when preparing for a talk with Q&A, creating shareable reference material for attendees, or building a safety-net glossary for live delivery.

talk-stage5-script

3046
from FlorianBruniaux/claude-code-ultimate-guide

Produces a complete 5-act pitch with speaker notes, a slide-by-slide specification, and a ready-to-paste Kimi prompt for AI slide generation. Requires validated angle and title from Stage 4. Use when you have a confirmed talk angle and need the full script, slide spec, and AI-generated presentation prompt.

talk-stage4-position

3046
from FlorianBruniaux/claude-code-ultimate-guide

Generates 3-4 strategic talk angles with strength/weakness analysis, title options, CFP descriptions, and a peer feedback draft, then enforces a mandatory CHECKPOINT for user confirmation before scripting. Use when deciding how to frame a talk, preparing a CFP submission, or choosing between multiple narrative angles.

talk-stage3-concepts

3046
from FlorianBruniaux/claude-code-ultimate-guide

Builds a numbered, categorized concept catalogue from the talk summary and timeline, scoring each concept HIGH / MEDIUM / LOW for talk potential with optional repo enrichment. Use when you need a structured inventory of concepts before choosing a talk angle, or when assessing which ideas have the strongest presentation potential.

talk-stage2-research

3046
from FlorianBruniaux/claude-code-ultimate-guide

Performs git archaeology, changelog analysis, and builds a verified factual timeline by cross-referencing git history with source material. REX mode only — skipped automatically in Concept mode. Use when building a REX talk and you need verified commit metrics, release timelines, and contributor data from a git repository.

talk-stage1-extract

3046
from FlorianBruniaux/claude-code-ultimate-guide

Extracts and structures source material (articles, transcripts, notes) into a talk summary with narrative arc, themes, metrics, and gaps. Auto-detects REX vs Concept type. Use when starting a new talk from any source material or auditing existing material before committing to a talk.

talk-pipeline

3046
from FlorianBruniaux/claude-code-ultimate-guide

Orchestrates the complete talk preparation pipeline from raw material to revision sheets, running 6 stages in sequence with human-in-the-loop checkpoints for REX or Concept mode talks. Use when starting a new talk pipeline, resuming a pipeline from a specific stage, or running the full end-to-end preparation workflow.

skill-creator

3046
from FlorianBruniaux/claude-code-ultimate-guide

Scaffold a new Claude Code skill with SKILL.md, frontmatter, and bundled resources. Use when creating a custom skill, standardizing skill structure across a team, or packaging a skill for distribution.

release-notes-generator

3046
from FlorianBruniaux/claude-code-ultimate-guide

Generate release notes in 3 formats (CHANGELOG.md, PR body, Slack announcement) from git commits. Automatically categorizes changes and converts technical language to user-friendly messaging. Use for releases, changelogs, version notes, what's new summaries, or ship announcements.

pr-triage

3046
from FlorianBruniaux/claude-code-ultimate-guide

4-phase PR backlog management with audit, deep code review, validated comments, and optional worktree setup. Use when triaging pull requests, catching up on pending code reviews, or managing a backlog of open PRs. Args: 'all' to review all, PR numbers to focus (e.g. '42 57'), 'en'/'fr' for language, no arg = audit only.

landing-page-generator

3046
from FlorianBruniaux/claude-code-ultimate-guide

Generate complete, deploy-ready landing pages from any repository. Use when creating a homepage for an open-source project, building a project website, converting a README into a marketing page, or standardizing landing pages across multiple repos.