a builder's codex
codex · operators · Anthropic · ins_anthropic-claude-code-subagents-haiku-routing

Claude Code subagents run in isolated context windows with model routing, enabling cost-optimized bulk delegation without polluting the orchestrator session

By Anthropic · AI research and deployment company · 2026-05-13 · research · Claude Code: Sub-agents

Tier B · TL;DR
Claude Code subagents run in isolated context windows with model routing, enabling cost-optimized bulk delegation without polluting the orchestrator session

Claim

Claude Code subagents are markdown files with YAML frontmatter declaring name, description, tools, and model. Each runs in its own context window, inherits parent permissions, and cannot spawn nested subagents. Haiku is explicitly supported for cost routing.

Mechanism

Context isolation means the orchestrator session does not absorb the raw output of bulk reads or expensive sub-tasks. The subagent returns structured results. The parent session sees only the summary. The model declaration in frontmatter lets you route cheap, mechanical work to Haiku and keep the orchestrator on Sonnet or higher.

Conditions

Holds when: You have discrete, bounded sub-tasks (bulk file reads, formatting passes, signal extraction) that do not need the full orchestrator context.

Fails when: The sub-task requires judgment that depends on the broader session context. Isolation is the feature and the constraint simultaneously. Nested subagent spawning is not supported.

Evidence

From the official Claude Code documentation:

"Control costs by routing tasks to faster, cheaper models like Haiku."

File format: markdown at ~/.claude/agents/.md (user scope) or .claude/agents/.md (project scope). Each subagent runs in its own context window, inheriting parent permissions.

Signals

Counter-evidence

Subagents cannot spawn nested subagents. For deeply recursive workflows, the architecture does not scale without flattening the task graph first. The context isolation that reduces cost also prevents subagents from using session history.

Open the interactive view → View original source → Markdown source →