The guide behind the reel
Claude Token Optimizer: install, audit, and status bar
You will install Token Optimizer for Claude Code, run a first audit, and get the status bar working. After that, it keeps Claude from paying twice for the same context and turns huge outputs into compact notes. Worth doing if you hit context limits or you keep pasting long logs, files, or command outputs.
What you need
4 things- Claude Code: the terminal (CLI), the VS Code extension, or the Claude desktop app
- Python 3 on your machine
- git
- About five minutes
The steps
7 steps-
Add the plugin’s marketplace entry
Open a Claude Code session and run this. It tells Claude Code where to find the plugin.
- /plugin marketplace add alexgreensh/token-optimizer
-
Install Token Optimizer
Now install the plugin itself:
/plugin install token-optimizer@alexgreensh-token-optimizer
That is the whole install. Its hooks switch on by themselves, so there is nothing to set up by hand. Start a new session so everything loads.
Windows: use this plugin install, not the install.sh script from the GitHub page. The script is only for macOS and Linux.
- /plugin install token-optimizer@alexgreensh-token-optimizer
-
Run a quick health check
To check it worked, run:
/token-optimizer quick
In about ten seconds you get a scan: how full your context window is, how much your setup costs before you have typed anything, and the biggest token offenders.
- /token-optimizer quick
-
Run the full audit once
Then run the full audit:
/token-optimizer
It goes through your CLAUDE.md, MEMORY.md, skills, MCP servers, slash commands and settings, and tells you how many tokens each one costs you on every single message. Then it shows you a plan with what to fix and how much each fix saves.
Nothing changes until you say yes, and it never deletes anything: skills and configs it removes are archived so you can put them back. Typical recovery is 5 to 15% of your context, and it is a one-time cleanup.
- /token-optimizer
-
Let it work in the background
From here it runs by itself in every session. This is the part that makes your limits last:
- Re-reads come back as just the changes. If Claude reads a file it already read, it gets a diff instead of the whole file. A 2,000-token re-read becomes about 50 tokens.
- Huge files come back as a map. Re-reading a big code file gives Claude a skeleton of its functions and imports instead. A 720KB file becomes about 250 tokens.
- Long command output gets summarised. Test runs, git, builds and logs are cut down to what matters. A 564-token pytest run becomes 115 tokens, and a 500-line search becomes 20 lines and a count.
- Big outputs are saved as notes. Any tool result over 4KB is archived to disk and Claude sees a short preview with a pointer. When it actually needs the full thing, it pulls it back withexpand, without re-running the command.
- Your work survives compaction. It saves a checkpoint before Claude compacts the conversation and puts back what the summary dropped, so Claude doesn't re-read everything afterwards.- If you need the full output later, use
expand.
- If you need the full output later, use
-
Use the status bar
In the Claude desktop app, the status bar shows up above your prompt in any new session after you install the plugin. Nothing extra to install.
It tells you the most urgent thing in one plain sentence, with at most one button:
- Clean up: compacts the conversation with Token Optimizer's guidance on what to keep
- Start fresh: asks for a second click, then saves a checkpoint, clears the chat and hands that checkpoint to your next message
- Keep warm: refreshes the prompt cache so your next message doesn't pay full price after a breakNext to it are five marks: quality grade, how full your context is, the cache countdown, your 5-hour limit and your weekly limit. Hover any of them for details. The arrow next to the little Clawd character opens more, including how many tokens Token Optimizer saved you in the last 30 days, and a link to the full dashboard.
In the terminal you get a status line instead: your context fill as a coloured bar (green, yellow, orange, red) and a quality grade from S down to F. When it goes orange or the grade drops, that is your cue to compact or start fresh.
- Hover the marks for details.
- Use the buttons: Clean up, Start fresh, Keep warm.
-
Turn on auto-update
Plugins don't update themselves unless you turn it on. Do it once:
/plugin
Then go to the Marketplaces tab, pick alexgreensh-token-optimizer and choose Enable auto-update.
- /plugin
Tips
- Install it one way only. If you use the plugin, don't also run the script install from GitHub, or every hook fires twice.
- If you already have your own status line, Token Optimizer leaves it alone. To use its bar instead, clear your statusLine setting and run
python3 measure.py setup-quality-barfrom the plugin's scripts folder. - If you run Claude Code's /statusline command later, it replaces the bar. Run
python3 measure.py setup-quality-baragain to get it back. - Don't want the desktop bar? Add
"TOKEN_OPTIMIZER_STATUS_BAR": "0"to the env block of~/.claude/settings.json. Everything else keeps working. - Cloud sessions on claude.ai/code don't load plugins. The docs have a separate setup script for those.
- It is free for personal use. The licence is PolyForm Noncommercial, with an extra permission for small businesses, so check it before you roll it out at a company.
- It runs fully on your machine and sends nothing anywhere.
Try next
- Open the dashboard at localhost:24842/token-optimizer to see where every token and dollar went
- Run Token Coach after a few weeks: it reads 30 days of your sessions and points out habits that burn tokens, like compacting too late or using Opus where Haiku would do
- Uninstall any time with
/plugin uninstall token-optimizer@alexgreensh-token-optimizer
That is the whole thing
If a step did not work the way I said, tell me in the comments on the reel: I fix these.