github alexgreensh/token-optimizer v5.11.36

3 hours ago

WSL-root install fix + full uninstall coverage

Fixed: Copilot/Codex/Hermes/OpenCode under WSL-root (issue #78)

When running as root under WSL, the installer correctly wrote hooks to your Windows profile (/mnt/c/Users/<you>/.copilot), but the runtime rejected that path as "not a safe directory" and fell back to /root/.copilot, so Token Optimizer looked installed but read the wrong home and measured nothing.

The runtime now honors COPILOT_HOME / CODEX_HOME / HERMES_HOME / OPENCODE_* pointing at a Windows profile under /mnt when running as root under WSL. The opt-in is gated on WSL detection (absolute, existing, non-symlink dir), so native-Linux behavior is byte-identical. The "rejected" warnings are gone and copilot-doctor reads the same home the installer wrote to.

Full uninstall coverage across all 7 runtimes

  • Claude Code: setup-hook --uninstall now actually removes Token Optimizer's SessionEnd hook (previously a silent no-op)
  • Codex: codex-install --uninstall now also clears the config.toml compact-prompt block and [tui] status-line residue, restoring anything it commented out on --force
  • OpenCode: new install.sh --opencode --uninstall
  • OpenClaw: documented native removal
  • New consolidated UNINSTALL section in the README covering all seven runtimes, with full-data-wipe commands

Hardening

CRLF preservation in Codex config round-trips, [tui] user-comment preservation, non-UTF-8 config handling, word-boundary hook matching to prevent false-positive removals, and a corrected VS Code extension id in the docs.

Every uninstall removes only what Token Optimizer installed; your own hooks, config keys, and plugin entries are never touched.

Don't miss a new token-optimizer release

NewReleases is sending notifications on new releases.