feat: add subagent model selection guidance for cost optimization
Global AGENTS.md: task-type-to-model-tier mapping table with decision rule — haiku for search/status, sonnet for standard coding/review, opus only for complex architecture and security. Claude RUNTIME.md: Task tool model parameter syntax with examples and quick reference table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
AGENTS.md
20
AGENTS.md
@@ -130,6 +130,26 @@ Load additional guides when the task requires them.
|
||||
- Installation and configuration are managed by Mosaic bootstrap and runtime linking.
|
||||
- If sequential-thinking is unavailable, you MUST report the failure and stop planning-intensive execution.
|
||||
|
||||
## Subagent Model Selection (Cost Optimization — Hard Rule)
|
||||
|
||||
When delegating work to subagents, you MUST select the cheapest model capable of completing the task. Do NOT default to the most expensive model for every delegation.
|
||||
|
||||
| Task Type | Model Tier | Rationale |
|
||||
|-----------|-----------|-----------|
|
||||
| File search, grep, glob, codebase exploration | **haiku** | Read-only, pattern matching, no reasoning depth needed |
|
||||
| Status checks, health monitoring, heartbeat | **haiku** | Structured API calls, pass/fail output |
|
||||
| Simple code fixes (typos, rename, one-liner) | **haiku** | Minimal reasoning, mechanical changes |
|
||||
| Code review, lint, style checks | **sonnet** | Needs judgment but not deep architectural reasoning |
|
||||
| Test writing, test fixes | **sonnet** | Pattern-based, moderate complexity |
|
||||
| Standard feature implementation | **sonnet** | Good balance of capability and cost for most coding |
|
||||
| Complex architecture, multi-file refactors | **opus** | Requires deep reasoning, large context, design judgment |
|
||||
| Security review, auth logic | **opus** | High-stakes reasoning where mistakes are costly |
|
||||
| Ambiguous requirements, design decisions | **opus** | Needs nuanced judgment and tradeoff analysis |
|
||||
|
||||
**Decision rule**: Start with the cheapest viable tier. Only escalate if the task genuinely requires deeper reasoning — not as a safety default. Most coding tasks are sonnet-tier. Reserve opus for work where wrong answers are expensive.
|
||||
|
||||
**Runtime-specific syntax**: See the runtime reference for how to specify model tier when spawning subagents (e.g., Claude Code Task tool `model` parameter).
|
||||
|
||||
## Skills Policy
|
||||
|
||||
- Use only the minimum required skills for the active task.
|
||||
|
||||
Reference in New Issue
Block a user