📈 GH Trending Explorer 🎲 Surprise me

← all repos

alexgreensh / token-optimizer

git clone https://github.com/alexgreensh/token-optimizer.git v5.13.57 · 1d ago

Find the ghost tokens. Fix them. Survive compaction. Avoid context quality decay.

+28
stars, 24h · #1,341
+~105
stars, 7 days · #2,038
+~450
stars, 30 days · #1,815
2.7k
★ total · +4% this week
208
forks · 1 open issues

Star history (as recorded here)

2026-10-20 · 2,606 ★ 2026-10-23 · 2,651 ★
LanguagePython
License—
Created2026-02-26 (7mo ago)
Last push1d ago
Watchers13
OwnerUser

GitHub topics

Links

README excerpt
English ·
 한국어 ·
 简体中文 ·
 日本語 
 Cut the tokens you waste. Keep the work you'd lose. 
 It runs automatically in the background. You keep working as usual. Run the audit when you want the full picture. 
## The 30-Second Version
Token Optimizer cuts the tokens your AI coding assistant wastes, keeps your work alive across sessions and compactions, and shows you where every dollar went on a live dashboard. **Most of it runs automatically. You install it, run the audit once, and the hooks do the rest.**
**Why not just use Headroom or RTK?** They compress command output, which covers 15-25% of your context. Token Optimizer covers that plus the other 75%: bloated configs, unused skills, stale memory, compaction loss, model misrouting, behavioral waste. Every saving is cache-safe and measured. The dashboard updates after every session, automatically.
Works on the AI coding tools below, with a Devin output-filter beta (manual skill, or `install.sh --devin --auto` for automatic compression):
## What You Get
**Runs automatically, every session, you do nothing:**
- 🔄 **Smart Compaction**: checkpoints before auto-compact, restores after
- 🗄️ **Session Continuity**: cross-session hints, cold-resume, checkpoint scoring
- 📦 **Active Compression**: 9 features, all on by default (delta diffs, skeletons, bash/search compression, lean-output nudges, quality nudges, loop detection, activity mode, decision extraction)
- 📊 **Quality Scoring**: 7 signals, real-time, letter grades S–F
- 🗃️ **Session Database**: SQLite, 15 tables, full audit trail, zero network
- 🔍 **Progressive Disclosure**: large outputs archived, expand on demand
- 🧠 **Context Intel Digest**: post-compaction re-orientation without re-reads
- 🔀 **Model Routing Nudges**: steers to the right tier for the task
**When you ask for it:**
- 🩺 `/token-optimizer`: full audit with guided fixes
- 📈 `/token-coach`: 30-day trend analysis with specific fixes
- ⚡ `quick`: 10-second health check
- 🎯 `route`: the model and effort this task actually needs, before you spend
- 🔧 `doctor`: installation check
- 💰 `savings`: dollar savings report
- 📋 `report`: per-component token breakdown
- 🌐 `dashboard`: open the full dashboard
- 📝 `memory-review`: MEMORY.md structural audit
- 📂 `expand`: retrieve archived tool result
- 🔙 `resume-lean`: reopen a cold session
Install, run `/token-optimizer` once, everything else runs automatically.
## A Status Bar Inside the Claude Desktop App
 A 30-second preview. Watch the full film with sound (50 seconds). 
Claude Code now lets a plugin add its own piece of interface, called a mod. Token Optimizer uses one to put your session's health right above the prompt: a quality grade, how full the context is, how long the cache stays warm, and both usage limits. One plain sentence tells you what needs attention, and one button fixes it. Clawd, the small orange mascot, acts out what the session is doing, so you can tell at a glance whether Claude is reading, editing, waiting for your OK, or done.
It