Active Compression
Token Optimizer transforms from a session health monitor into an active context protector. Five opt-in features that actively reduce tokens, with honest risk assessment and dashboard toggles.
New features
Delta Mode (Smart Re-reads) — ON by default
When the AI re-reads a file after editing it, returns a unified diff instead of the full file. Your biggest single win if you read-and-edit frequently.
Quality Nudges — ON by default
Warns you when context quality drops suddenly (e.g., from 85 to 60). Catches context rot before it forces a bad compaction.
Loop Detection — ON by default
Detects when the AI is stuck retrying the same thing. A single caught loop typically saves 10–50K tokens.
Bash Output Compression — OFF (opt-in)
Rewrites safe read-only commands (git status/log/diff, pytest, npm install, ls) through a compression wrapper. Credentials are preserved verbatim via pre-compression scan. Lossy by design — opt-in only.
Structure Map Beta Telemetry — OFF (opt-in)
Tracks when structure maps fire so you can measure their value on your own code-heavy sessions.
Three ways to manage
- Dashboard —
token-dashboard→ Manage tab. v5 is the first card with per-feature toggles, risk levels, and impact estimates. - CLI —
measure.py v5 status|enable|disable|info|welcomeandmeasure.py compression-stats. - Env vars —
TOKEN_OPTIMIZER_*overrides for CI/scripts.
Privacy
All telemetry stays 100% local. No network calls, no phone-home, no analytics endpoint. The new compression_events SQLite table lives at ~/.claude/_backups/token-optimizer/trends.db on your machine.
First-run welcome
A one-time welcome screen on your first session after upgrading explains each feature, its default state, and how to toggle it.
Docs
Full v5 section added to README with feature-by-feature breakdown, impact estimates, risk levels, and toggle reference.