token-optimizer · alexgreensh — Claude Code skill: what it does, how to install
Audits Claude Code and Codex setups for context waste, applies approved fixes, and calculates reclaimed tokens.
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a claude-codeWhat token-optimizer does
The skill inspects where your coding setup spends its context window. It reviews CLAUDE.md, MEMORY.md, registered MCP tools, skills, and caching parameters to find dead weight. Every change requires explicit approval, and files are backed up before anything is modified.
Under the hood, six agents gather context metrics concurrently, while a synthesis agent compiles the final optimization plan. The workflow relies on Python 3 running measure.py for runtime checks and metric dashboards. Without Python 3 installed, the pre-check fails immediately and halts the audit.
What it helps with
- audit instructions in CLAUDE.md and MEMORY.md for bloat
- detect inactive MCP servers and redundant skills
- benchmark context window savings before and after cleanup
- tune cache lifetime and compaction thresholds
Example prompts for the agent
- Run token-optimizer to audit my context window usage
- Check for context waste in CLAUDE.md and MCP settings
- Measure context savings before and after cleaning skills
How to install token-optimizer
1Skills CLI (Vercel)
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a claude-code2Manually: put the files in place
~/.claude/skills/token-optimizer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/token-optimizer/
1Skills CLI (Vercel)
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a codex2Manually: put the files in place
.agents/skills/token-optimizer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a cursor2Manually: put the files in place
.cursor/skills/token-optimizer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install alexgreensh/token-optimizer token-optimizer2Manually: put the files in place
.github/skills/token-optimizer/SKILL.md1Skills CLI (Vercel)
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a gemini-cli2Platform CLI
gemini skills install https://github.com/alexgreensh/token-optimizer --path skills/token-optimizerManually: put the files in place
.devin/skills/token-optimizer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add alexgreensh/token-optimizer --skill token-optimizer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about token-optimizer
How to install token-optimizer in Claude Code?
Run npx skills add alexgreensh/token-optimizer --skill token-optimizer -a claude-code in your terminal.
What does token-optimizer do?
It analyzes configuration files, prompts, and MCP servers, proposes ways to trim context waste, and calculates before-and-after token savings.
What are the requirements for token-optimizer?
Your system must have Python 3 available, as runtime detection and report dashboards execute measure.py.
Similar skills
All skills for Agent setup: memory, context, orchestration →token-optimizer by other authors comes first.