Rtk Token Optimizer

Published by williamcorrea23 in sap-router-skill

Review recommended1 installs

What this skill does

|

Add Rtk Token Optimizer to your agent

Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.

Install with a prompt

Paste this into a compatible coding agent:

add this skill "rtk-token-optimizer" from https://github.com/williamcorrea23/sap-router-skill

Install with the CLI

Run this command in a controlled environment after reviewing the repository:

npx skills add https://github.com/williamcorrea23/sap-router-skill --skill rtk-token-optimizer

Skill instructions

RTK Token Optimizer Skill

RTK is a CLI proxy that intercepts shell commands and returns compact, LLM-optimized summaries instead of raw verbose output — saving 60-90% of token consumption.

Local Reference

sap-router-skill\bundled\tools\rtk\

What RTK Does

RTK wraps common dev commands and returns only what matters to the LLM:

CommandWithout RTKWith RTK
git log --oneline -5050 lines of SHAs + messages10-line summary
cargo test200+ lines of test outputPASSED: 47/47 or compact failure
npm install300+ lines of progressinstalled 142 packages
pytest -vFull verbose outputSummary table

Installation (Antigravity / Gemini)

RTK supports Google Antigravity via .agents/rules/antigravity-rtk-rules.md:

# Install RTK binary (Windows - via cargo)
cargo install rtk

# Or download pre-built binary
# https://github.com/rtk-ai/rtk/releases

# Initialize for Antigravity
rtk init --agent antigravity

This creates .agents/rules/antigravity-rtk-rules.md in your project, which instructs Antigravity to route shell commands through rtk.

Initialization for All Supported Agents

rtk init -g                    # Claude Code (global)
rtk init -g --gemini           # Gemini CLI (global)
rtk init -g --copilot          # GitHub Copilot (global)
rtk init -g --agent cursor     # Cursor (global)
rtk init -g --codex            # Codex (global)
rtk init --agent antigravity   # Antigravity (project-scoped)
rtk init --agent kilocode      # Kilo Code (project-scoped)
rtk init --agent cline         # Cline / Roo Code (project-scoped)

RTK Usage in Sessions

# RTK transparently intercepts these:
rtk git log --oneline -20
rtk cargo test
rtk npm install
rtk pytest tests/

# Analytics
rtk gain          # Token savings summary for current session
rtk gain --30d    # 30-day savings report

# Discovery
rtk discover      # Show which commands RTK optimizes in your project
rtk verify        # Verify hook is active for current agent

# Telemetry (opt-in only)
rtk telemetry status
rtk telemetry enable   # explicit opt-in
rtk telemetry disable

Config (~/.config/rtk/config.toml)

[hooks]
exclude_commands = ["curl", "playwright"]  # skip rewrite for these

[tee]
enabled = true          # save raw output on failure
mode = "failures"       # "failures" | "always" | "never"

Integration with SAP Router Skill

In the SAP Router context, RTK is especially useful for:

  • git log when reviewing transport histories
  • abaplint output compression (ABAP linting runs)
  • pytest for SAP skill test runner output (driver.py)
  • Healthcheck output: python scripts/healthcheck.py — RTK can compress the 35-MCP probe output

SAP Router + RTK pattern:

# Instead of:
python scripts/healthcheck.py  # → verbose 35-MCP output

# Via RTK:
rtk python scripts/healthcheck.py  # → compact summary

Token Saving Estimates

ToolAvg Savings
git log/status/diff65-85%
cargo/rust70-90%
npm/yarn/pnpm60-75%
pytest/unittest70-85%
make/gradle55-70%

Uninstall

rtk init -g --uninstall    # Remove hooks
cargo uninstall rtk

References

Files included

  • SKILL.md

More skills

Rtk Token Optimizer: Install, Source and Security