| name | rtk-token-optimizer |
| description | RTK CLI proxy that reduces LLM token consumption by 60-90% on common dev commands.
Use when running git, cargo, npm, pytest, or any CLI tool inside an AI coding session.
Rewrites verbose command outputs to compact summaries before they reach the context window.
Supports Antigravity (Gemini), Claude Code, Cursor, Codex, Copilot, and 10+ other agents.
Source: https://github.com/rtk-ai/rtk — offline-capable single Rust binary, zero deps.
|
| triggers | ["rtk","token savings","context reduction","LLM token","git log verbose","cargo test output","npm install output","reduce output","compress tool output"] |
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:
| Command | Without RTK | With RTK |
|---|
git log --oneline -50 | 50 lines of SHAs + messages | 10-line summary |
cargo test | 200+ lines of test output | PASSED: 47/47 or compact failure |
npm install | 300+ lines of progress | installed 142 packages |
pytest -v | Full verbose output | Summary table |
Installation (Antigravity / Gemini)
RTK supports Google Antigravity via .agents/rules/antigravity-rtk-rules.md:
cargo install rtk
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
rtk init -g --gemini
rtk init -g --copilot
rtk init -g --agent cursor
rtk init -g --codex
rtk init --agent antigravity
rtk init --agent kilocode
rtk init --agent cline
RTK Usage in Sessions
rtk git log --oneline -20
rtk cargo test
rtk npm install
rtk pytest tests/
rtk gain
rtk gain --30d
rtk discover
rtk verify
rtk telemetry status
rtk telemetry enable
rtk telemetry disable
Config (~/.config/rtk/config.toml)
[hooks]
exclude_commands = ["curl", "playwright"]
[tee]
enabled = true
mode = "failures"
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:
python scripts/healthcheck.py
rtk python scripts/healthcheck.py
Token Saving Estimates
| Tool | Avg Savings |
|---|
| git log/status/diff | 65-85% |
| cargo/rust | 70-90% |
| npm/yarn/pnpm | 60-75% |
| pytest/unittest | 70-85% |
| make/gradle | 55-70% |
Uninstall
rtk init -g --uninstall
cargo uninstall rtk
References