Subagent Patterns: Parallel, Sequential, Background
Table of content
Subagents let you delegate work while staying focused on your main task. The key is knowing which dispatch pattern to use.
Parallel Dispatch
Run multiple subagents simultaneously when tasks are independent.
When to use:
- 3+ unrelated tasks
- No shared state between tasks
- Clear file boundaries (each agent works on different files)
- All tasks are well-defined upfront
Examples:
- Implementing features across separate modules
- Running tests while writing documentation
- Refactoring multiple independent components
Task A ──────────►
Task B ──────────► (all run simultaneously)
Task C ──────────►
Key requirement: Tasks must not touch the same files. If agents edit shared files, you get merge conflicts and wasted work.
Sequential Dispatch
Chain subagents when later tasks depend on earlier results.
When to use:
- Tasks have dependencies
- Shared files or state
- Scope is unclear until previous task completes
- Output of one task is input to the next
Examples:
- Generate schema, then implement models, then write tests
- Research options, then implement chosen approach
- Scaffold structure, then fill in implementation
Task A ──► Task B ──► Task C (each waits for previous)
Key requirement: Define clear handoff points. Each agent should produce output the next agent can consume.
Background Dispatch
Move subagents to background when results aren’t blocking your current work.
When to use:
- Research or analysis tasks
- Long-running operations
- Nice-to-have information
- You need to continue working on something else
Examples:
- Researching library options while you build the interface
- Running comprehensive test suites
- Generating documentation while you code
- Analyzing codebase patterns
Background: Research ─────────────────►
(notifies when done)
Main work: Implementation ──────────►
Key shortcut: Ctrl+B moves a running subagent to background. The main session continues while the subagent works independently.
Decision Framework
Ask these questions in order:
Are tasks independent with no shared files?
- Yes → Parallel
- No → Continue
Does the next task need output from the previous?
- Yes → Sequential
- No → Continue
Do you need the results to continue your current work?
- Yes → Sequential (wait for it)
- No → Background
Quick Reference
| Pattern | Tasks | Shared State | Blocking |
|---|---|---|---|
| Parallel | 3+ independent | None | All at once |
| Sequential | Dependent chain | Yes | One at a time |
| Background | Research/analysis | None | Non-blocking |
Common Mistakes
Using parallel when files overlap. Two agents editing the same file creates conflicts. Check file boundaries first.
Using sequential when parallel works. Unnecessary waiting. If tasks are truly independent, run them together.
Forgetting background exists. Long research tasks don’t need to block you. Move them to background and keep working.
Practical Tips
- Start with fewer subagents. Two parallel agents are easier to manage than five.
- Give each subagent a specific, bounded task. Vague instructions lead to scope creep.
- For sequential chains, define what “done” looks like for each step.
- Check background agents periodically. They might have questions or be stuck.
Next: Orchestrating Complex Workflows
Get updates
New guides, workflows, and AI patterns. No spam.
Thank you! You're on the list.