What is token-optimizer?
token-optimizer is a Claude Code mod by alexgreensh that the Token Optimizer status bar on its own, for its tests. It ships inside the token-optimizer plugin. It is listed under Cost & usage and has 2,591 GitHub stars.
| Type | Claude code mod |
|---|---|
| Author | alexgreensh |
| Repository | alexgreensh/token-optimizer |
| Popularity | 2,591 GitHub stars |
| Category | Cost & usage |
| Security | High risk (52/100) |
| Rank | #51 of 5,272 Claude Code mods; #3 in Cost & usage |
| Last commit | 2026-10-16 |
| Stars this week | +56 |
| Hooks | 13 events |
| Sees | classic hooks, compaction, every prompt, every tool call, subagent spawns |
| Draws on | AbovePrompt |
Is token-optimizer safe to install?
token-optimizer scores 52/100 on the MCPMods security check: High risk. Things to review: starts processes outside the sandbox; reads environment variables; watches every prompt or event. It passed 2 of 8 checks.
Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.
| Check | Result |
|---|---|
| No network access | Pass |
| Starts processes outside the sandbox | Review |
| Writes no files or config | Pass |
| Reads environment variables | Review |
| Watches every prompt or event | Review |
| Drives Claude (model calls, prompts) | Note |
| Validator reported problems | Note |
| No license detected | Note |
API calls in its code
| Call | What it means |
|---|---|
$.clock.after | |
$.clock.every | |
$.clock.now | |
$.command.run | drives Claude |
$.env.get | reads env vars |
$.fs.list | reads files |
$.fs.read | reads files |
$.fs.stat | reads files |
$.model.fork | drives Claude |
$.process.run | runs processes |
$.session.cwd | |
$.session.id | |
$.session.usage | |
$.state.get | |
$.state.set | |
$.store.delete | keeps its own state |
$.store.get | keeps its own state |
$.store.set | keeps its own state |
$.ui.log | draws interface |
$.ui.resolve | draws interface |
$.ui.toast | draws interface |
How do I install token-optimizer?
- Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
claude --version
- Read its footprint. This lists every event it hooks and every API call it makes, without running it.
git clone https://github.com/alexgreensh/token-optimizer claude plugin validate ./token-optimizer/desktop/token-optimizer-desktop
- Install it. Run this in your terminal, then /reload-plugins in an open session.
git clone https://github.com/alexgreensh/token-optimizer && claude --plugin-dir ./token-optimizer/desktop/token-optimizer-desktop
Or ask Claude to set it up
Paste this into Claude Code and it installs token-optimizer for you:
Install the "token-optimizer" Claude Code mod from https://github.com/alexgreensh/token-optimizer/tree/main/desktop/token-optimizer-desktop. Run claude plugin validate on it first and show me what it can access before you enable it.