Subagents and Parallel Work
A single agent in a single context window hits limits: long tasks bloat the window and unrelated concerns pollute each other. The pro move is delegation. A lead agent spawns subagents, each with its own clean context and a narrow job, then collects their results. This keeps every context small and lets independent work happen in parallel.
Step 1: Define a reusable subagent
In Claude Code you define a subagent as a Markdown file with a role, the tools it may use, and optionally a cheaper model. A focused reviewer or test-writer subagent can run on Claude Sonnet 4.6 to save cost while the lead runs on Claude Opus 4.8.
---
name: reviewer
description: Reviews diffs for bugs and security issues. Use after any change.
tools: Read, Grep, Bash
model: sonnet
---
You are a senior reviewer. Read the diff, flag correctness bugs,
missing tests, and security risks. Be specific and cite file:line.
Do not rewrite code; report findings only.Step 2: Delegate explicitly
Ask the lead agent to fan work out. Independent pieces (write the migration, write the tests, draft the docs) can run as separate subagents and merge back, while dependent steps stay sequential.
Step 3: Isolate risky work in worktrees
For truly parallel feature work, give each agent its own Git worktree so they edit separate working directories on separate branches and never clobber each other. Merge the branches when each passes its checks.