What problem does it solve?
It reduces the cost and latency of running Claude Code agents by auditing agent definition files and trimming wasted tokens and bloated prompt text.
Core Features & Use Cases
- Agent inventory & completeness checks: Scans all agent
.md definitions and flags missing or incomplete YAML frontmatter fields (name, description, color, tools, model).
- Model tier assignment: Recommends the cheapest viable model tier (haiku/sonnet/opus), based on whether the agent is procedural vs. reasoning-heavy, with opus reserved for explicit justification.
- Token efficiency optimization: Flags overly long agent bodies and provides targeted cut guidance to achieve a lean 25–40 line body while preserving functional instructions.
- Change application & verification: Updates frontmatter, adjusts
model: tiers, trims bodies when over 50 lines, and includes a verification loop to confirm the results.
Quick Start
Ask the AI to run optimize-agents to audit your .claude/agents/ files, recommend haiku vs sonnet per agent, and trim any agents over 50 lines.