Skip to content

v0.1.0 — Two-way token optimization

Latest

Choose a tag to compare

@prashanthaitha24 prashanthaitha24 released this 15 Jun 21:59

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 compressioncompressOutput engine + compress_output MCP 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 PostToolUse hook 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 / /optimize path.)
  • Custom rules (promptOptimizer.customRules) — your own find → replace mappings (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's gain).
  • Log attachments (promptOptimizer.compressAttachmentLogs) — .log/.out/.err get 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

34/34 unit tests passing.