Inspired by RTK: optimize-pilot now compresses both ends of the token pipeline — your prompts and command/tool output — while keeping the same deterministic, no-model-call, meaning-preserving contract.
Highlights
- Output compression —
compressOutputengine +compress_outputMCP tool: strips ANSI/progress noise, collapses exact-repeat lines into… (×N), truncates oversized output to head+tail. Never paraphrases. Typically 50–90% on noisy logs. - Automatic Bash-output compression (Claude Code) — a
PostToolUsehook compresses long command output before it enters context. Install once, no per-call invocation. (Prompt-text rewriting isn't possible via hooks, so input compression stays on the explicit@optimize//optimizepath.) - Custom rules (
promptOptimizer.customRules) — your ownfind → replacemappings (literal or regex) alongside the ~120 built-ins. /discover+optimize_discover— dry-run report of tokens saved and per-rule-group attribution, no model call.- Lifetime savings — VS Code "Show Lifetime Token Savings" command +
/optimize-stats(à la RTK'sgain). - Log attachments (
promptOptimizer.compressAttachmentLogs) —.log/.out/.errget output compression; code/JSON/YAML still byte-for-byte. - Standalone CLI (
claude/cli.js) —noisy-cmd 2>&1 | optimize-pilot,--prompt,--discover. - Homebrew formula (
Formula/optimize-pilot.rb). - Fix — filler removal now runs before contractions, so phrases like "it is important to note that" are stripped (previously leaked as "it's …").
Install
- VS Code: download
optimize-pilot-0.1.0.vsixbelow →code --install-extension optimize-pilot-0.1.0.vsix - Marketplace: https://marketplace.visualstudio.com/items?itemName=thavionai.optimize-pilot
34/34 unit tests passing.