▲ 143 today3.1k starsPython
Token Optimizer trims AI coding assistant token waste
What is token-optimizer?
Token Optimizer watches your AI coding tool and cuts away tokens that never contribute to the result. It also keeps your work alive across sessions and shows a live dashboard of the dollars saved.
Who it is for
If you spend any money on an LLM-powered coding assistant, you’ll want to stop paying for wasted context.
How token-optimizer works
When installed as a plugin or script it injects hooks that watch every AI coding session. Before the assistant auto-compacts its context it writes a checkpoint, then restores the lost information after compaction. All session data, token usage and audit records are saved in a local SQLite database with 15 tables. Compression routines like delta diffs, skeletons and loop detection run automatically, and a live dashboard shows a quality grade and token savings.
What you can do with it
- Run /token-optimizer to get a full audit and step-by-step fixes.
- Use /token-coach for a 30-day trend report with specific savings actions.
- Enter quick for a 10-second health check of the current session.
- Open the dashboard to see live token usage, dollar savings and context quality.
Good to know
- The project is licensed under PolyForm Noncommercial, limiting commercial use.
- Windows users must install via the plugin; the install.sh script is not supported on Windows.
- It requires Python 3.9+ and only runs on the listed platforms (Claude Code, Codex, OpenCode, OpenClaw, Hermes, Pi, Copilot, Cursor, Antigravity, Grok).
Written from the project's own README.
Try it in 60 seconds
You need: Python 3
No one-line install. The README has the setup steps.
New projects are not vetted. Skim the code, and run it in a fresh folder or a container before giving it your files or keys.
The story so far
Early Signal first spotted alexgreensh/token-optimizer on November 24, 2026, when it had 3.1k GitHub stars. It now has 3.1k. On its busiest day it gained 143 stars. Early Signal files it under Security, Coding, MCP & Skills.