rtk-compress

Installation
SKILL.md

Save 60-90% of LLM tokens on shell commands, file reads, and test outputs.

This skill wraps rtk (Rust Token Killer) — a CLI proxy that filters and compresses command outputs before they reach your LLM context.

Commands Reference

Smart File Operations

rtk ls .                                # Token-optimized directory tree
rtk read file.rs                         # Smart file reading (compressed output)
rtk read file.rs -l aggressive           # Signatures only (strips bodies)
rtk smart file.rs                      # 2-line heuristic code summary

Search & Diff

rtk find "*.rs" .                        # Compact find results
rtk grep "pattern" .                    # Grouped search results
rtk diff file1 file2                    # Condensed diff

Git Operations

rtk git status                         # Compact status
rtk git log -n 10                      # One-line commits
rtk git diff                           # Condensed diff
rtk git add                           # → "ok"
rtk git commit -m "msg"                    # → "ok abc1234"
rtk git push                          # → "ok main"
rtk git pull                           # → "ok 3 files +10 -2"

GitHub CLI

rtk gh pr list                         # Compact PR listing
rtk gh pr view 42                       # PR details + checks
rtk gh issue list                      # Compact issue listing
rtk gh run list                        # Workflow run status

Test Runners

rtk cargo test                        # Show failures only (-90%)
rtk npm test                           # Errors/warnings only
rtk vitest run                         # Vitest compact (failures only)
rtk playwright test                   # E2E results (failures only)
rtk pytest                            # Python tests (-90%)
rtk go test                            # Go tests (NDJSON, -90%)

Build & Lint

rtk cargo build                        # Cargo build (-80%)
rtk cargo clippy                        # Cargo clippy (-80%)
rtk tsc                                # TypeScript errors grouped by file
rtk next build                          # Next.js build compact
rtk ruff check                          # Python linting (JSON, -80%)
rtk golangci-lint run                   # Go linting (JSON, -85%)

Package Managers

rtk pnpm list                          # Compact dependency tree
rtk pip list                           # Python packages (auto-detect uv)
rtk pip outdated                         # Outdated packages

Containers

rtk docker ps                           # Compact container list
rtk docker images                       # Compact image list
rtk docker logs <container>                # Deduplicated logs
rtk kubectl pods                        # Compact pod list
rtk kubectl logs <pod>                    # Deduplicated logs

Data & Analytics

rtk json config.json                    # Structure without values
rtk deps                                # Dependencies summary
rtk env -f AWS                        # Filtered env vars
rtk log app.log                         # Deduplicated logs
rtk curl <url>                         # Auto-detect JSON + schema
rtk summary <long command>          # Heuristic summary
rtk proxy <command>                     # Raw passthrough + tracking

Token Savings Analytics

rtk gain                               # Summary stats
rtk gain --graph                       # ASCII graph (last 30 days)
rtk gain --history                     # Recent command history
rtk gain --daily                       # Day-by-day breakdown
rtk gain --all --format json            # JSON export for dashboards
rtk discover                            # Find missed savings opportunities

Rules for the Agent

Always prefix commands with rtk when possible:

Use rtk for:

  • rtk git status / rtk git log / rtk git diff
  • rtk ls . / rtk read <file>
  • rtk cargo test / rtk cargo build / rtk cargo clippy
  • rtk npm test / rtk pytest / rtk go test
  • rtk tsc / rtk ruff check

Don't use rtk for:

  • Commands whose output is piped to other tools (e.g., git log | grep ...)
  • Scripts that parse raw output
  • Commands where you need the exact full output

If rtk fails:

Fall back to the bare command. Never block a task because of compression.

Token Savings Reference

Operation Without rtk With rtk Savings
git status ~300 ~60 -80%
git log -20 ~2,000 ~400 -80%
cat file.ts ~2,000 ~600 -70%
cargo test ~5,000 ~500 -90%
pytest ~2,000 ~200 -90%
Typical session ~150k ~45k -70%

Links

Related skills

More from sopaco/money-never-sleep

Installs
1
GitHub Stars
2
First Seen
5 days ago