Token Optimizer
Local plugin that audits and compresses AI coding assistant context, checkpoints sessions across compaction, and tracks token and cost savings on a dashboard.
At a Glance
Free for noncommercial use under the PolyForm Noncommercial License 1.0.0 (source-available, not OSI open source).
Engagement
Available On
Alternatives
Listed Nov 2026
About Token Optimizer
Token Optimizer is a source-available plugin by Alex Greenshpun for AI coding assistants such as Claude Code, Codex, OpenCode, OpenClaw, Hermes, GitHub Copilot, Pi, Cursor, Google Antigravity (beta) and Grok Build (beta). It audits a setup for wasted tokens, compresses new content as it enters the context window, checkpoints sessions before compaction, and reports token and dollar usage on a local dashboard. The project documents that it runs locally with no runtime dependencies and no telemetry.
What It Is
Token Optimizer is a context-management tool for AI coding agents. After installation, a one-time /token-optimizer audit produces a per-component token breakdown of items such as CLAUDE.md, skills, MCP servers and memory files, applies safe fixes and recommends the rest. Hooks then run automatically each session. Each supported platform has its own native integration, and a Devin output-filter skill is in contract-only beta.
How the Waste Model Works
The docs divide waste into three kinds: structural (bloated configs, unused skills, stale memory), runtime (verbose command output, oversized tool results, repeated file reads) and behavioral (cache expiry, late compaction, retry loops, model misrouting). Active compression covers delta re-reads, code-skeleton substitution, bash and search output compression, lean-output nudges, quality nudges, loop detection, activity mode and decision extraction. Large tool results are archived to disk and can be retrieved on demand with an expand command.
Compaction Survival and Session Continuity
The tool checkpoints session state at several context-fill thresholds and quality drops, then restores what the compaction summary dropped. It also injects a digest of large tool outputs so the model can re-orient without re-reading. Across sessions, relevance-scored checkpoints surface as hints, and a cold-resume command reconstructs lean context from a local SQLite database.
Dashboard, Scoring and Coaching
A dashboard regenerates after each session and shows per-turn token and cost breakdowns across four pricing tiers, cache analysis, subagent spend and a savings tracker. A 0-100 quality score with S-F grades appears in a terminal status line, and a desktop status bar is available for the Claude desktop app. /token-coach analyzes 30 days of history, and 11 waste detectors, per-task model and effort advice, and a Fleet Auditor are documented.
Licensing Model
The code is published under PolyForm Noncommercial 1.0.0 with a written small-business permission, so it is source-available rather than OSI open source. Commercial use beyond that permission requires contacting the author.
Community Discussions
Be the first to start a conversation about Token Optimizer
Share your experience with Token Optimizer, ask questions, or help others learn from your insights.
Pricing
Noncommercial
Free for noncommercial use under the PolyForm Noncommercial License 1.0.0 (source-available, not OSI open source).
- Personal use, research, hobby projects
- Use by charitable, educational, public research, public safety/health, environmental and government organizations
- Runs fully local, zero runtime dependencies
- Small-business additional permission referenced in LICENSE-SMALL-BUSINESS.md (terms not supplied)
Commercial License
Commercial use requires contacting the author for a license; price not published.
- Commercial use license
Capabilities
Key Features
- Setup audit with per-component token breakdown
- Active compression: delta re-reads, structure maps, bash and search output compression
- Smart compaction with checkpoints and restore
- Session continuity with cross-session hints and cold-resume
- Tool result archive with on-demand expand
- Live local dashboard with cost across four pricing tiers
- Quality scoring with S-F grades and status line
- Loop detection and quality nudges
- Token Coach 30-day trend analysis
- Waste detectors and Fleet Auditor
- Per-task model and effort routing advice
- Memory health audit
- Desktop status bar for the Claude desktop app
- Custom command filters via TOML
- Zero runtime dependencies and zero telemetry
