token-optimizer

Solid

Audit your OpenClaw setup for token waste, context bloat, and cost optimization opportunities

AI & Automation 2,235 stars 171 forks Updated yesterday NOASSERTION

Install

View on GitHub

Quality Score: 81/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
89
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Token Optimizer for OpenClaw You are a token optimization expert. Audit the user's OpenClaw agent setup, detect waste patterns, and provide actionable fixes with dollar savings. ## Workflow ### Phase 0: Detect + Scan Run the scan to collect session data: ```bash npx token-optimizer scan --days 30 ``` If no sessions found, tell the user and stop. Otherwise, report the scan summary (agents, sessions, total cost). ### Phase 1: Audit Run the full waste detection: ```bash npx token-optimizer audit --days 30 ``` Present findings grouped by severity. For each finding: 1. Name the pattern (e.g., "Heartbeat Model Waste") 2. Explain what's happening in plain language 3. Show the monthly $ waste 4. Give the exact fix ### Phase 2: Coaching For each finding, explain WHY it matters: - **Heartbeat Model Waste**: "Your cron agent is using Sonnet to check if there's work. That's like hiring a surgeon to take your temperature." - **Empty Heartbeat Runs**: "Your agent loads 50K tokens of context, finds nothing to do, and exits. That's $X/month to stare at an empty inbox." - **Session Bloat**: "Your sessions hit 500K+ tokens without compacting. The last 70% is mostly stale context you already acted on." ### Phase 3: Actionable Fixes For each finding, provide the exact config change. Don't just suggest, write the fix: - Config file path - The specific field to change - Before and after values - How to verify the fix worked ## Rules - Always run scan before audit (need data first) - Sho...

Details

Author
alexgreensh
Repository
alexgreensh/token-optimizer
Created
6 months ago
Last Updated
yesterday
Language
Python
License
NOASSERTION

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

token-optimiser

Deliver any task at the lowest token cost that still clears the quality bar. Opens with a fast triage that scores the request and recommends which Claude model to run it on, with a one-action switch line, then executes on a tool and output budget matched to that tier. Use this skill on virtually every substantive task — research, coding, analysis, document creation, agent pipelines, multi-step workflows — and especially when the user says 'token efficient', 'which model should I use', 'reduce my API costs', 'this is burning tokens', 'cheap', 'quick', or gives a terse instruction. Also use it when designing or reviewing anything that calls the Claude API or runs an agent loop, because routing, caching and batching decisions are cheapest to make at design time.

0 Updated 1 months ago
jamiecooper4-netizen
AI & Automation Solid

token-coach

Plan a token-efficient Claude Code or Codex setup, or get a quick health check. Coaching, not the full audit (use token-optimizer for that).

2,235 Updated yesterday
alexgreensh
AI & Automation Listed

token-optimizer

Cut wasted tokens on every Claude interaction. Use this skill whenever the user mentions tokens, cost, billing, usage, context size, model choice, restarting a chat, or running into limits — and also proactively any time the conversation shows signs of token waste: long context, repeated reference material, vague prompts that will need clarification, full-file rewrites when a diff would do, deep-thinking on a lookup question, or many sequential web searches. Apply this skill across claude.ai, the Anthropic API, and Claude Code; the levers differ by surface and the skill flags which apply where.

0 Updated 2 weeks ago
chadjardine