Model routing for subagents: let Haiku do the chores, Opus the hard parts
TL;DR
A subagent is a Markdown file in .claude/agents/ with a model frontmatter field (sonnet, opus, haiku, inherit or a full ID). Send reading/searching to a small model, keep the big one for design and review. Set a default with CLAUDE_CODE_SUBAGENT_MODEL.
A cheap code-scouting subagent
---
name: code-scout
description: Find files, read logs, list call sites of a function. Use when surveying the codebase.
tools: Read, Glob, Grep
model: haiku
---
Read only, never edit. Return file + relevant lines, max 20 items.Model resolution order
- The model Claude passes when invoking the subagent (if any).
- The
modelfrontmatter field (inherit= main session's model). - The
CLAUDE_CODE_SUBAGENT_MODELenvironment variable. - The main session's model.
Suggested roles
| Role | Model | Why |
|---|---|---|
| Scouting code, reading logs, summarizing | haiku | Lots of reading, little reasoning |
| Writing tests, small refactors | sonnet | Balanced speed/quality |
| Architecture, security review | opus / inherit | Needs deep reasoning |