Grok Build
Install
Section titled “Install”From a clone of alexgreensh/token-optimizer:
bash install.sh --grok# Or install just the adapter hooks/payload:TOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py grok-install --dry-runTOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py grok-installThe installer writes its own <grok-home>/hooks/token-optimizer.json and copies the bridge modules to <grok-home>/token-optimizer/plugin/. Re-run after updating the checkout. It preserves other hook files.
Verify and dashboard
Section titled “Verify and dashboard”TOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py grok-doctor --probeTOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py grok-summaryTOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py dashboard --serveThe doctor checks binary discovery, safe home resolution, payload integrity, hook wiring, stored session shapes, and synthetic probe behavior. A passing synthetic probe does not establish real host hook firing. The dashboard port is 24848.
Uninstall
Section titled “Uninstall”TOKEN_OPTIMIZER_RUNTIME=grok python3 skills/token-optimizer/scripts/measure.py grok-uninstallThe adapter uninstall removes only its own hooks and payload; session data stays. See Grok Build capabilities for token/cost limits and Configuration for home overrides.
The shared engine reserves port 24848, but the foreign-runtime guard blocks setup-daemon for Grok. Use the foreground dashboard command above; do not confuse a port assignment with a working persistent install command.
