skill
claude-optimizer
Token optimizer for Claude Code: your top model orchestrates while Opus plans, Sonnet executes, and Haiku handles grunt work. Plus a decision matrix that stops AI from stuffing decks and websites with
Set up
Skills are installed by placing their folder where your agent loads skills.
The download comes from github.com/geraldho81/claude-optimizer itself, not from our server, so what you get is exactly what its author published.
Install instructions come from the README
README
synced Oct 22, 2026Claude Code Optimizer
Stop burning your most expensive model's tokens on grunt work, and stop letting AI stuff decorative images into your decks.
This repo installs two permanent behaviors into Claude Code:
-
Model Delegation Hierarchy. Your session runs on your most advanced available model - Fable 5 if you have it, otherwise Opus 5 - and that model acts as orchestrator only. It sets direction, splits the work, and reviews results. Opus subagents are the secondary planner: they handle intensive thinking, architecture, and complex analysis, even if your orchestrator is Opus 5 itself (you can pin an older Opus like 4.8 via a custom agent if you want a cheaper planner). Sonnet and Haiku subagents split execution by complexity: Sonnet for anything needing judgment, Haiku for pure mechanics like searches, renames, and conversions. Your expensive tokens go to judgment, not grinding.
-
Image Decision Matrix. Before any agent adds an image to a deck, website, or report, it answers three questions in order: Does this need an image at all? If yes, can a real image be sourced (Unsplash, Pexels, Google Images, client assets) instead of generated? Only when sourcing cannot deliver does it generate. No decorative filler, no generation for generation's sake. Generation only runs if an image-generation tool (e.g. the Codex CLI) is actually installed - without one, agents source only and note in their output when a generated image would have served better. And when you explicitly ask for generated images ("generate the images with Codex"), the matrix steps aside: your request is the decision and generation runs immediately.
Both rules reach the main session AND every subagent, enforced through ~/.claude/CLAUDE.md plus SessionStart and SubagentStart hooks in ~/.claude/settings.json.
Install
Two options. Both take under a minute and apply to every future session on that machine.
Option A: Paste the installer prompt (easiest)
- Open
installer-prompt.md. - Copy everything below the line.
- Paste it into Claude Code as one message and approve the file edits.
Option B: Install the skill
- Copy
skills/claude-code-optimizer/into~/.claude/skills/:git clone https://github.com/geraldho81/claude-optimizer.git cp -r claude-optimizer/skills/claude-code-optimizer ~/.claude/skills/ - In Claude Code, run
/claude-code-optimizerand approve the edits. - The skill also handles updates and uninstall: ask it to "remove the Claude Code Optimizer setup".
What gets modified
| File | Change |
|---|---|
~/.claude/CLAUDE.md | Two sections appended: delegation hierarchy, image matrix |
~/.claude/settings.json | Two hooks merged in: SessionStart, SubagentStart |
Nothing else is touched. Existing settings, permissions, and hooks are preserved. Changes take effect from your next new session.
Honest limits
- These are instructions, not hard enforcement. Claude Code has no setting that physically forces subagent model tiers. In practice the CLAUDE.md rules plus per-agent hook injection steer reliably, but the model can still deviate on edge cases.
- The delegation savings show up on substantive tasks (multi-file builds, audits, research). Tiny tasks are handled directly by design, since spawning an agent would cost more than the work.
- Image generation references "your image-generation tool, e.g. the Codex CLI". If you have a different image tool wired into Claude Code, it slots in the same way. If no such tool is installed, the matrix falls back to sourcing only - agents won't attempt generation, and they'll flag in their output when a generated image would have served better.
License
MIT. Share it, fork it, adapt it.