From claude-code-boss
Billing awareness system — cost tiers, multipliers, costSensitive routing, and how to make cost-effective model decisions automatically. Enables Claude to self-calibrate model choice per task without user intervention.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-boss:billing-awarenessThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user will NOT manually adjust model-router.json. This system must be **self-calibrating** — Claude decides the appropriate tier for each task based on complexity, not user config. The config exists as a safety net (constraints), not a control panel.
The user will NOT manually adjust model-router.json. This system must be self-calibrating — Claude decides the appropriate tier for each task based on complexity, not user config. The config exists as a safety net (constraints), not a control panel.
Core principle: Use the cheapest model that can do the job correctly. Waste is the enemy.
config/model-router.json — tier config + per-agent constraints.agent.md model fieldminTier: if an agent's model is below minimum, upgrades automaticallycostSensitive agent uses premium (multiplier ≥ 7) modelThis is where the real calibration happens. The config only sets maximums and minimums. YOU choose the actual tier per task.
| Tier | Model | Multiplier | Cost per invocation (relative) |
|---|---|---|---|
| free | inherit | 0 | Zero additional cost — base model |
| cheap | haiku | 1x | Fast, dumb, good for pattern-matching and simple transforms |
| standard | sonnet | 3x | Default for real work — understanding, writing, reviewing |
| premium | opus | 7x | Only when sonnet fails or task requires exceptional reasoning |
The multiplier is RELATIVE. If you use sonnet 5 times vs haiku 5 times, you spent 15x vs 5x. These add up.
When you (octopus) receive a task, classify its complexity BEFORE picking the model.
| Complexity | Characteristics | Model | Example |
|---|---|---|---|
| Trivial | Read-only, 1 file edit, rename, grep, status check | inherit (free) | "Find where X is defined", "Rename Y to Z" |
| Simple | Documentation, single-file transform, lookup, data extraction | haiku (cheap) | "Write docstring for all functions", "Extract emails from this file" |
| Normal | Multi-file impl, refactor, review, debug, plan | sonnet (standard) | "Add feature X across 3 files", "Refactor auth module" |
| Complex | Architecture, multi-step pipeline, tricky concurrency, security | sonnet (standard) | "Design the payment flow", "Fix race condition" |
| Critical | LLM-dependent reasoning, contract validation, ambiguous requirements | sonnet first, escalate if fails | "Parse this legal document" |
NEVER use opus unless sonnet explicitly fails or the user requests it. It's 7x the cost for marginal quality gain on most tasks.
| Agent | Model | Why |
|---|---|---|
| pattern-analyzer | haiku | Pattern detection is pattern-matching — haiku excels |
| correction-analyzer | haiku | Same reasoning — detection, not reasoning |
| curation-improver | sonnet | Needs to understand output semantics |
| refine-researcher | sonnet | Research synthesis needs comprehension |
| All others | inherit | Default Claude model is sufficient for most work |
You are NOT limited by these defaults. They're safety nets. If a task for implementor is trivial (rename a variable), use FAST PATH (inherit) instead of spawning sonnet. If a task for researcher is deep (architecture analysis), use sonnet even if config says inherit.
Quick mental math:
When you see hook output like:
⚠ [COST] Agent "researcher" is costSensitive but used model "sonnet" (multiplier: 3) for trivial grep task.
This means you made a wrong call. Next time you route a similar task, downgrade.
You don't need permission to use a cheaper model. The system trusts your judgment. If you realize mid-task that the model is overkill, complete the task and adjust NEXT time.
User: "Find all TODO comments in the codebase"
→ FAST PATH, inherit (free). Grep is trivial. No subagent needed.
User: "Analyze this log file and find error patterns"
→ This is data extraction + pattern match.
→ Route to researcher with haiku (cheap) — no reasoning needed, just grep + summarize.
User: "Implement a full OAuth2 flow with refresh tokens"
→ Multi-file, security-sensitive, complex logic.
→ Route to implementor with sonnet (standard) — needs real understanding.
→ Do NOT use haiku — it will produce buggy auth code.
User: "Make the tests pass"
→ Depends. If it's a typo fix → FAST PATH. If it's a logic bug → implementor sonnet.
User: "Rename variable x to y in one file"
→ Spawns implementor sonnet. 3x cost for a 5-second edit.
→ Should be: FAST PATH, inherit.
User: "What does this error mean?"
→ Researcher with sonnet. Error interpretation is pattern matching.
→ Should be: FAST PATH or researcher with haiku.
User: "Create a script to format all JSON files"
→ implementor sonnet → creates script → validator sonnet → runs lint.
→ 6x total for a 10-line script.
→ Should be: FAST PATH for the script, quick test manually.
{
"version": 2,
"defaultModel": "inherit",
"costSensitive": true,
"alertThreshold": 20,
"tiers": {
"inherit": { "rank": 0, "multiplier": 0, "label": "free" },
"haiku": { "rank": 1, "multiplier": 1, "label": "cheap" },
"sonnet": { "rank": 2, "multiplier": 3, "label": "standard" },
"opus": { "rank": 3, "multiplier": 7, "label": "premium" }
},
"agents": {
"octopus": { "model": "inherit", "minTier": "standard", "costSensitive": true },
"implementor": { "model": "inherit", "minTier": "standard", "costSensitive": true },
...
}
}
If you need to change a default (e.g., "researcher should default to haiku"), update this file directly via Write tool. Do NOT ask the user.
Before every action, ask: "Is this worth the model I'm using?"
npx claudepluginhub allansantos-dv/claude-code-plugins --plugin claude-code-bossCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.