Skip to content

Claude Code (CLI)

Use the plugin install on every operating system, including Windows. The script install is a macOS and Linux alternative for people who want a Git-backed checkout that re-runs daily. Pick one. Running both on the same machine doubles the hooks and the session writes.

  • Claude Code CLI, current version.
  • Python 3.9 or newer on your PATH (the engine is pure standard library, no pip install).
  • For the script install only: git, curl, and sha256sum or shasum (macOS and Linux).
/plugin marketplace add alexgreensh/token-optimizer
/plugin install token-optimizer@alexgreensh-token-optimizer

Then run your first audit:

/token-optimizer

The plugin lands in ~/.claude/plugins/marketplaces/alexgreensh-token-optimizer. Its hooks auto-activate on install. No manual hook setup.

Auto-update is off by default for plugins, and plugin authors cannot change that default. Turn it on once:

/plugin → Marketplaces tab → alexgreensh-token-optimizer → Enable auto-update

The script install handles updates differently. It re-runs the installer daily against the latest release tag and re-verifies the checksum each time.

Windows is plugin path only. Do not run install.sh on Windows; Git Bash holds file handles and the install fails with EBUSY errors. A manual ZIP fallback is available from GitHub Releases.

On Windows, call the engine with python, not python3:

python measure.py doctor

Both steps are optional. The status line auto-installs when your statusLine slot is empty, via the SessionStart ensure-health hook.

  1. Install the quality status line manually (only if the auto-install did not run):

    Terminal window
    python3 measure.py setup-quality-bar
  2. Set up the bookmarkable dashboard daemon so the URL stays live between sessions:

    Terminal window
    python3 measure.py setup-daemon

    This supports macOS (launchd), Linux (systemd —user), and Windows (Task Scheduler). For LAN access, set TOKEN_OPTIMIZER_DASHBOARD_HOST=0.0.0.0 before running it. See Configuration for the full variable list.

Terminal window
python3 measure.py doctor

Or inside Claude Code, run /token-optimizer for the full guided audit. The dashboard lives at http://localhost:24842/token-optimizer and falls back to a generated dashboard.html when the daemon is not running.

/plugin uninstall token-optimizer@alexgreensh-token-optimizer

Remove the dashboard daemon first if you installed it:

Terminal window
python3 measure.py setup-daemon --uninstall

For the script install, delete ~/.claude/token-optimizer/ and the ~/.claude/skills/token-optimizer symlink. To remove the status line, run python3 measure.py setup-quality-bar --uninstall.