A free, open-source tool that shows exactly where your Claude Code usage is going. One command finds the invisible overhead eating your limits on every single message.
It's a Python tool that scans your Claude Code setup and shows you exactly how many tokens each component costs (every skill, MCP server, config file, and system prompt) so you can cut the waste you didn't know was there.
Ghost tokens don't load once. They get re-sent on every single message. Here's what that looks like for a typical power user:
python3 --version to check. If you see an error or a version below 3.8, download Python from python.org.
Open your Terminal and paste this command. It clones the tool into your Claude Code directory and sets everything up automatically.
curl -fsSL https://raw.githubusercontent.com/alexgreensh/token-optimizer/main/install.sh | bash
You'll see it install in about 10 seconds. It creates a folder at ~/.claude/token-optimizer and links itself as a Claude Code skill.
Open Claude Code and type this. It runs the quick scan, which takes about 10 seconds and immediately shows your biggest token offenders.
/token-optimizer quick
You'll see a breakdown of every component and how many tokens it costs. The tool highlights anything above a threshold and flags unused components.
The scan shows you exactly what's costing tokens. Now you decide what to cut. Token Optimizer won't change anything without showing you a diff first.
Common things it finds:
Want the full picture? Run the interactive audit with guided fixes:
/token-optimizer
This runs 6 parallel analysis agents and walks you through each fix with before/after diffs. It backs up everything before changing anything.
Once installed, you've got a full toolkit for understanding your Claude Code usage. Here are the most useful commands:
/token-optimizer quality
Shows a 7-signal quality score for your current session. Tells you how much your AI's accuracy has degraded and whether you should start a fresh session.
/token-optimizer dashboard
Opens an interactive HTML dashboard with per-session costs, per-turn token breakdowns, trend charts, and spike detection.
/token-optimizer coach
Detects 8 named anti-patterns (like "The Kitchen Sink": too many skills loaded) and gives you specific fixes for each one.
/token-optimizer savings
Shows cumulative dollar savings from optimisations you've made, with daily averages and monthly estimates.