by alexgreensh
Find the ghost tokens. Fix them. Survive compaction. Avoid context quality decay.
# Add to your Claude Code skills
git clone https://github.com/alexgreensh/token-optimizerGuides for using ai agents skills like token-optimizer.
Last scanned: 5/4/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-04T06:42:27.506Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}See how token-optimizer compares with popular alternatives.
token-optimizer is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by alexgreensh. Find the ghost tokens. Fix them. Survive compaction. Avoid context quality decay. It has 2,337 GitHub stars.
Yes. token-optimizer passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/alexgreensh/token-optimizer" and add it to your Claude Code skills directory (see the Installation section above).
token-optimizer is primarily written in Python. It is open-source under alexgreensh on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh token-optimizer against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
See comparison
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 Claude Code (CLI and VS Code), OpenCode, OpenClaw, Codex, Hermes, GitHub Copilot, Cursor, Google Antigravity (beta), and Grok Build (beta). Windsurf is next on the roadmap.
Claude Code (recommended):
/plugin marketplace add alexgreensh/token-optimizer
/plugin install token-optimizer@alexgreensh-token-optimizer
Then in Claude Code: /token-optimizer
Enable auto-update after installing. Claude Code ships third-party marketplaces with auto-update off by default.
/plugin→ Marketplaces tab → selectalexgreensh-token-optimizer→ Enable auto-update. One-time, 10 seconds.After install, run
/token-optimizeronce to set up hooks. From there, everything runs automatically: compression, checkpoints, quality scoring, dashboard updates. You don't need to run any command again unless you want an audit.
Claude Code cloud sessions (claude.ai/code). A cloud session runs in a fresh container and never reads the plugins installed on your machine, so the two commands above are not enough there (
/pluginitself is not available in cloud sessions). Either enable Token Optimizer for your claude.ai account (Desktop app → Customize → plugins), or commit this to the repo's.claude/settings.jsonso every cloud session on that repo installs it at start:{ "extraKnownMarketplaces": { "alexgreensh-token-optimizer": { "source": { "source": "github", "repo": "alexgreensh/token-optimizer" } } }, "enabledPlugins": { "token-optimizer@alexgreensh-token-optimizer": true } }Hooks, compression and redaction behave the same inside the container. Each cloud session starts with an empty state directory, so the dashboard and audit history there cover that session only.
Codex:
codex plugin marketplace add alexgreensh/token-optimizer
Then in the Codex TUI: /plugins and install Token Optimizer. See docs/codex.md.
OpenCode: add token-optimizer-opencode to the plugin array in your opencode.json:
{ "$schema": "https://opencode.ai/config.json", "plugin": ["token-optimizer-opencode"] }
See opencode/README.md.
OpenClaw:
openclaw plugins install github:alexgreensh/token-optimizer
See openclaw/README.md.
Hermes:
git clone https://github.com/alexgreensh/token-optimizer.git
token-optimizer/install.sh --hermes
See hermes/README.md.
GitHub Copilot:
git clone --depth 1 https://github.com/alexgreensh/token-optimizer.git
cd token-optimizer
bash install.sh --copilot
See docs/copilot.md.
Cursor:
git clone --depth 1 https://github.com/alexgreensh/token-optimizer.git
cd token-optimizer
bash install.sh --cursor
See docs/cursor.md.
Google Antigravity:
git clone --depth 1 https://github.com/alexgreensh/token-optimizer.git
cd token-optimizer
bash install.sh --antigravity
See [docs/antigravity.md](docs/ant