# Claude Code subagents workflow examples

Workflow patterns for using Claude Code subagents to split research, implementation, review, migration, and verification work.

## Quick Answer

Use subagents when a task can be split into independent research, verification, or bounded implementation slices. Keep urgent blocking work local, give each subagent a concrete output, and avoid asking several agents to modify the same files.

## Best for

Developers using Claude Code for larger codebases, migrations, and multi-step reviews.

## Use this guide to

Claude Code users want concrete examples for when and how to delegate work to subagents.

## Recommended play

1. Use subagents first for research, review, and verification because those tasks have clear outputs and low file-conflict risk.
2. Move to split implementation only when file ownership is already disjoint.
3. Close every subagent with a decision: accept, reject, or park the finding, instead of blending all outputs into vague consensus.

## Subagent delegation matrix

Choose the subagent pattern by task shape, not by how large or exciting the project feels.

| Area | Use subagents when | Keep local when | Expected output |
| --- | --- | --- | --- |
| Research | Official docs, changelogs, or API behavior can be checked independently | The answer depends on unresolved local code details | Source-backed summary and risk notes |
| Review | A plan or diff needs a second pass for bugs, missing tests, or assumptions | The reviewer would need to edit the same files immediately | Prioritized findings with file or requirement references |
| Implementation | Modules and files are clearly separated | Two agents need the same files or shared state | Scoped patch or implementation notes |
| Verification | One agent can run checks while the main thread inspects results | The failing behavior is still not reproduced | Commands, outputs, and pass/fail conclusion |

## Execution steps

1. **Name the decision** — Write the exact decision the main agent needs, such as whether a migration path is safe or which docs changed.
2. **Bound context and ownership** — Give the subagent only the files, docs, or question it needs, and state whether it may edit or only report.
3. **Collect findings before merging** — Read every subagent result, separate evidence from opinion, and decide which findings change the main path.
4. **Verify the integrated result** — Run the final checks in the main thread so the completed work has one accountable owner.

## Common pitfalls

- **Spawning agents before the boundary is clear**: Write the desired output first, then decide whether parallel work is actually independent.
- **Letting multiple agents edit the same area**: Use subagents for analysis or disjoint files; keep shared edits in the main thread.
- **Averaging conflicting advice**: Pick the result with better evidence and explain the decision in the main thread.

## Implementation checklist

- [ ] Name the output you need before spawning a subagent.
- [ ] Keep each task self-contained.
- [ ] Assign disjoint file ownership for edits.
- [ ] Close agents after collecting results.
- [ ] Merge conclusions into one decision instead of averaging blindly.

## FAQ

**Q: What should you do first?**

Use subagents first for research, review, and verification because those tasks have clear outputs and low file-conflict risk.

**Q: Who is this guide for?**

Developers using Claude Code for larger codebases, migrations, and multi-step reviews.

**Q: What evidence supports this guide?**

This guide uses listed source material from Anthropic. Source links and scope notes are available on this page.

## Evidence sources

- [Claude Code subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) — Anthropic. Official subagent capability reference.
- [Claude Code overview](https://docs.anthropic.com/en/docs/claude-code/overview) — Anthropic. Places subagents in the broader Claude Code workflow.

## Related guides

- [Claude Code hooks and MCP setup](/guides/claude-code-hooks-mcp-setup) — Subagent workflows often need hooks or MCP servers once repeated tasks become procedural.
- [AI coding agent instruction files](/guides/agents-md-vs-claude-md-cursorrules-copilot-instructions) — Subagents perform better when repository instructions are current and tool-specific guidance is not contradictory.
- [loop engineering for AI coding agents](/guides/loop-engineering-ai-coding-agents) — Subagents are building blocks inside plan-execute-verify loops that need iteration caps and escalation rules.

---
Canonical: https://www.kyenai.com/guides/claude-code-subagents-examples
