Parallel Fan-Out: Running Multiple Agents at Once
- Distinguish between foreground and background subagent execution and know when to use each
- Dispatch multiple agents in a single response to achieve true parallel execution
- Use the Agent view to monitor running, blocked, and completed tasks across active subagents
Sequential vs. Parallel: The Core Trade-Off
By default, Claude Code runs tool calls sequentially — one at a time. For simple workflows, this is fine. But for multi-agent work, sequential execution means waiting for each agent to finish before the next one starts. If three independent research tasks each take two minutes, sequential execution takes six minutes. Parallel execution takes two.
Claude Code supports true parallel subagent execution. Multiple agents can run simultaneously in their own context windows, each doing work independently. When all finish, the parent receives all their summaries and synthesizes them together.
Foreground vs. Background Execution
Every subagent runs in one of two modes:
Foreground: The subagent runs in the main terminal view. You see its output. Permission prompts pass through directly to you. The parent conversation waits for it to finish before continuing. Use foreground for interactive work or when you want to monitor progress in real time.
Background: The subagent runs concurrently. The parent conversation can continue or spawn other agents. If the background agent hits a permission prompt, it surfaces in the main session with the agent's name attached so you know which agent is asking. As of Claude Code v2.1.198, subagents run in the background by default.
You can force background execution in two ways:
- Set
background: truein the agent's frontmatter definition - Press Ctrl+B during a running task to move it to the background mid-execution
To disable background tasks entirely in a session: set the environment variable CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1.
Dispatching Multiple Agents in One Response
The key to parallel execution is dispatching multiple agents in the same response. When Claude calls the Agent tool multiple times in one turn, those calls execute concurrently rather than sequentially.
To trigger this, structure your prompt to make parallel work explicit:
Run these three tasks in parallel:
1. Use the dependency-checker agent to audit package.json for outdated dependencies
2. Use the security-auditor agent to check src/ for SQL injection risks
3. Use the docs-auditor agent to find all public functions missing docstrings
Report when all three are done.
Claude dispatches all three agents in one response. They run concurrently. When all three finish, the parent receives their summaries and can synthesize the combined findings.
The Agent View: Monitoring What's Running
When multiple agents are running, tracking their status manually is impractical. The Agent view — launched in May 2026 — gives you a live dashboard of all active subagents in your session.
Access it with: claude agents
The Agent view shows each running subagent with its current status: running, blocked (waiting for permission approval), or done. You can see what tool each agent is currently executing, whether it is waiting for user input, and when it finishes.
Permission prompts from background agents appear in the main session labeled with the agent's name. You approve or deny there, and the agent resumes automatically.
The Cost Equation
Parallel execution is faster. It is also more expensive. Each subagent has its own context window, and each context window uses tokens independently. Five agents running in parallel use five times the tokens of one agent doing the same work sequentially.
This is usually worth it for genuinely independent tasks. Parallelism is a performance investment — you pay with tokens to save wall-clock time. The calculation changes when tasks are not truly independent: parallel agents that end up duplicating work or waiting on shared state pay the cost without getting the benefit.
The rule of thumb: parallelize when tasks are independent and time matters. Sequence when tasks depend on each other or when token cost is the primary constraint.
- Background execution (default since v2.1.198) lets multiple agents run concurrently — the parent continues while workers execute in parallel
- Dispatch multiple agents in a single response (Claude calls Agent tool multiple times in one turn) to achieve true parallelism
- Press Ctrl+B mid-execution to send a foreground task to the background; set <code>background: true</code> in frontmatter to always background a specific agent
- The <code>claude agents</code> Agent view (launched May 2026) shows every active subagent's status: running, blocked waiting for permission, or done
- Parallel agents cost N× tokens for 1/N wall-clock time — worth it for independent tasks, wasteful when tasks overlap or share state