Claude FastClaude Fast
Agents

Claude Code Sub Agent Best Practices: Parallel, Sequential, Background

Configure your central Claude thread to automatically choose the right sub-agent execution pattern. Master parallel, sequential, and background delegation.

Problem: Your main Claude Code session (the "central AI") spawns sub-agents constantly, but it doesn't inherently know when to run them in parallel versus sequential chains versus background. Without explicit routing rules in your CLAUDE.md, it guesses - and often guesses wrong.

Quick Win: Add this routing decision framework to your CLAUDE.md:

## Sub-Agent Routing Rules
 
**Parallel dispatch** (ALL conditions must be met):
 
- 3+ unrelated tasks or independent domains
- No shared state between tasks
- Clear file boundaries with no overlap
 
**Sequential dispatch** (ANY condition triggers):
 
- Tasks have dependencies (B needs output from A)
- Shared files or state (merge conflict risk)
- Unclear scope (need to understand before proceeding)
 
**Background dispatch**:
 
- Research or analysis tasks (not file modifications)
- Results aren't blocking your current work

Your central Claude thread reads these rules and makes smarter delegation decisions automatically.

Teaching Your Central AI to Delegate

Here's what most developers miss: Claude Code isn't one AI - it's an orchestration system. Your main chat session is the "central AI" that coordinates specialist sub-agents. The quality of your work depends on how well you've taught that central thread to delegate.

The Task tool supports three execution modes. Each serves different needs:

PatternCentral AI Uses WhenRisk If Wrong Choice
ParallelIndependent domains, no file overlapMerge conflicts, inconsistent state
SequentialDependencies exist, shared resourcesWasted time on serialized independent work
BackgroundResearch while user continues workingLost results if not checked

Without explicit rules, your central AI defaults to conservative sequential execution - safe but slow.

Parallel: Domain-Based Splitting

The central AI should dispatch parallel sub-agents when work spans independent domains. Configure domain-based routing in your CLAUDE.md:

## Domain Parallel Patterns
 
When implementing features across domains, spawn parallel agents:
 
- **Frontend agent**: React components, UI state, forms
- **Backend agent**: API routes, server actions, business logic
- **Database agent**: Schema, migrations, queries
 
Each agent owns their domain. No file overlap.

The critical rule: Parallel only works when agents touch different files. Your central AI needs to understand domain boundaries to route correctly.

Sequential: Dependency Chains

When output from one step feeds the next, the central AI must enforce ordering. Common chains:

ChainWhy Sequential
Schema -> API -> FrontendData structure must exist before interfaces
Research -> Planning -> ImplementationUnderstanding before execution
Implementation -> Testing -> SecurityBuild, validate, then audit

Add chain definitions to your CLAUDE.md so the central AI recognizes dependency patterns and doesn't parallelize work that must be serial.

Background: Non-Blocking Research

When the central AI spawns research tasks, it should background them automatically so you can continue working. Press Ctrl+B during any sub-agent execution, or configure automatic backgrounding:

## Background Execution Rules
 
Run in background automatically:
 
- Web research and documentation lookups
- Codebase exploration and analysis
- Security audits and performance profiling
- Any task where results aren't immediately needed

Check /tasks anytime to see background agent progress. Results surface when complete. See async workflows for the full background execution guide.

The Invocation Quality Problem

Most sub-agent failures aren't execution failures - they're invocation failures. The central AI spawns a sub-agent with vague instructions, insufficient context, or unclear deliverables. The sub-agent does its best with bad input.

Bad invocation: "Fix authentication"

Good invocation: "Fix OAuth redirect loop where successful login redirects to /login instead of /dashboard. Reference the auth middleware in src/lib/auth.ts."

The difference is context density. Sub-agents have temporary context windows - they can't go back and ask clarifying questions. Your central AI needs rules for crafting complete invocations.

This is where most CLAUDE.md configurations stop. They handle routing but not invocation quality. Professional Claude Code setups include full invocation protocols that ensure sub-agents receive comprehensive context, explicit instructions, relevant file references, and clear success criteria with every dispatch.

Common Orchestration Mistakes

Over-parallelizing: Launching 10 parallel agents for a simple feature wastes tokens and creates coordination overhead. Group related micro-tasks.

Under-parallelizing: Running four independent analyses sequentially when they could parallelize. Look for domain independence.

Vague invocations: Sending sub-agents with "implement the feature" instead of specific scope, file references, and expected outputs.

Level Up Your Orchestration

The routing rules above will immediately improve how your central AI delegates work. But there's more to professional orchestration:

  • Constitutional invocation requirements - ensuring every sub-agent dispatch includes the four essential components
  • Agent routing tables - mapping task types to specialist agents by domain
  • Context handoff protocols - preserving state across sequential agent chains
  • Session-based coordination - tracking multi-phase implementations

For the complete sub-agent orchestration system used in ClaudeFast - including our full invocation protocol and specialist agent definitions - check out the Code Kit in the button by the table of contents.

Start with the routing rules. Add them to your CLAUDE.md today and watch your central AI make smarter delegation decisions. For deeper patterns, explore task distribution and agent fundamentals.

Last updated on

On this page

Claude Code ready in seconds.