Auto-restore your quality bar when /statusline wipes it
Claude Code's built-in /statusline slash command rewrites the statusLine key in ~/.claude/settings.json, which could silently overwrite Token Optimizer's quality bar while the cache hook kept running in the background. Quality data was still being tracked — you just couldn't see it.
Starting in v3.5.1, SessionStart detects this exact case and auto-restores the quality bar. You don't need to run anything. Just start a new session and you'll see a one-line notice explaining what happened:
[Token Optimizer] Statusline was replaced (e.g., by /statusline).
Auto-restored. Opt out permanently: measure.py setup-quality-bar --uninstall
How Token Optimizer tells the difference between "clobber" and "I meant to do that"
The survival of the cache hook is the signal. If you had the full quality bar at some point, the hook is installed in your UserPromptSubmit hooks. /statusline and most other statusline replacements touch statusLine but leave hooks alone — so a foreign statusLine with our cache hook still present is strong evidence of accidental clobber.
Direct runs of setup-quality-bar still respect a pre-existing foreign statusline with integration instructions. Only the SessionStart recovery path uses force.
Sticky opt-out
setup-quality-bar --uninstall now writes quality_bar_disabled: true to ~/.claude/token-optimizer/config.json. SessionStart honors the flag forever — no more auto-restore.
Explicit re-install (setup-quality-bar with no args) clears the flag. "I changed my mind" just works.
Natural-language opt-out
You can also just tell Claude Code "remove the Token Optimizer statusline". Claude reads the skill, runs the uninstall command, and the flag sticks across sessions.
What changed
scripts/measure.py— new_set_quality_bar_disabled()helper,setup_quality_bar(force=True)parameter for the recovery path, auto-restore branch inensure-health, sticky config write from--uninstall, explicit re-install clears the flag.README.md— troubleshooting entries under Live Quality Bar covering all four paths: clobber recovery, sticky opt-out, re-enable, custom statusline integration..claude-plugin/plugin.json,.claude-plugin/marketplace.json— 3.5.0 → 3.5.1.
Verified locally
Seven scenarios, all passing: clobber→restore, opted-out no-op, uninstall writes flag, sticky survives SessionStart, reinstall clears flag, direct install respects custom statusline, intact setup stays quiet.
Upgrade
Plugin users: /plugin update token-optimizer (or wait for the automatic marketplace refresh). Script install users get it on the next daily git pull --ff-only.
Full changelog: v3.5.0...v3.5.1