4 4
5# Run agents in parallel5# Run agents in parallel
6 6
7> Compare the ways Claude Code can take on multiple tasks at once: subagents, agent view, agent teams, and isolated worktree sessions.7> Compare the ways Claude Code can take on multiple tasks at once: subagents, agent view, agent teams, and dynamic workflows.
8 8
9[Subagents](/en/sub-agents), [agent view](/en/agent-view), [agent teams](/en/agent-teams), and [worktrees](/en/worktrees) each parallelize work in a different way. The right one depends on whether you want to stay in each conversation yourself, hand tasks off and check back later, or have Claude coordinate a group of workers for you.9[Subagents](/en/sub-agents), [agent view](/en/agent-view), [agent teams](/en/agent-teams), and [dynamic workflows](/en/workflows) each parallelize work in a different way. The right one depends on whether you want to stay in each conversation yourself, hand tasks off and check back later, or have Claude coordinate a group of workers for you.
10 10
11| Approach | What it gives you | Use it when |11| Approach | What it gives you | Use it when |
12| :----------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------- |12| :--------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13| [Subagents](/en/sub-agents) | Delegated workers inside one session that do a side task in their own context and return a summary | A side task would flood your main conversation with search results, logs, or file contents you won't reference again |13| [Subagents](/en/sub-agents) | Delegated workers inside one session that do a side task in their own context and return a summary | A side task would flood your main conversation with search results, logs, or file contents you won't reference again |
14| [Agent view](/en/agent-view) | One screen to dispatch and monitor sessions running in the background, opened with `claude agents`. Research preview | You have several independent tasks and want to hand them off, check status at a glance, and step in only when one needs you |14| [Agent view](/en/agent-view) | One screen to dispatch and monitor sessions running in the background, opened with `claude agents`. Research preview | You have several independent tasks and want to hand them off, check status at a glance, and step in only when one needs you |
15| [Agent teams](/en/agent-teams) | Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default | You want Claude to split a project into pieces, assign them, and keep the workers in sync |15| [Agent teams](/en/agent-teams) | Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default | You want Claude to split a project into pieces, assign them, and keep the workers in sync |
16| [Worktrees](/en/worktrees) | Separate git checkouts so parallel sessions never touch each other's files | You're running several sessions yourself, or your subagents edit overlapping files |16| [Dynamic workflows](/en/workflows) | A script that runs many subagents and cross-checks their results, for work too big to coordinate one turn at a time or that needs more than a single pass. Research preview | A job outgrows a handful of subagents, or you want findings verified against each other: a codebase-wide audit, a 500-file migration, cross-checked research, or a plan drafted from several angles |
17| [`/batch`](/en/commands) | A planned split of one large change into 5 to 30 worktree-isolated subagents that each open a pull request | A repo-wide migration or mechanical refactor you can describe in one instruction |
18 17
19In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an [MCP server](/en/mcp).18In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an [MCP server](/en/mcp).
20 19
21You can combine these approaches. Agent view automatically moves each dispatched session into its own worktree when it needs to edit files, and a session you're working in can spawn subagents that each get their own worktree.20Two more tools support this work without being a way to run agents themselves:
21
22* [Worktrees](/en/worktrees) give each session a separate git checkout, so parallel sessions never edit the same files. Use them for sessions you run yourself. Agent view moves each dispatched session into its own worktree automatically, and subagents you spawn can each get one too.
23* [`/batch`](/en/commands) is a [skill](/en/skills) that has Claude split one large change into 5 to 30 worktree-isolated subagents that each open a pull request. It's a packaged use of subagents and worktrees, not a separate coordination style.
24
25A few other features run Claude without you driving each step, but they solve a different problem than splitting work across agents:
26
27* A [background bash command](/en/interactive-mode#background-bash-commands) runs one shell command without blocking the conversation. It doesn't spawn an agent.
28* A [forked subagent](/en/sub-agents#fork-the-current-conversation) is a subagent that inherits your full conversation context instead of starting fresh. It's a way to spawn a subagent, not a separate surface.
29* A [routine](/en/routines) runs a session on a schedule in Anthropic's cloud, not in parallel on your machine.
22 30
23<Note>31<Note>
24 Running several sessions or subagents at once multiplies token usage. See [Costs](/en/costs) for usage and rate-limit details.32 Running several sessions or subagents at once multiplies token usage. See [Costs](/en/costs) for usage and rate-limit details.
28 36
29The right approach depends on who coordinates the work, whether the workers need to communicate, and whether they edit the same files:37The right approach depends on who coordinates the work, whether the workers need to communicate, and whether they edit the same files:
30 38
31* **Who coordinates the work?** If you want Claude to delegate and collect results inside one conversation, use [subagents](/en/sub-agents). If you're handing off independent tasks and checking back on them, use [agent view](/en/agent-view). If you want Claude to plan, assign, and supervise a group of workers, use [agent teams](/en/agent-teams), which are experimental and disabled by default.39* **Who coordinates the work?**
40 * Claude delegates and collects results inside one conversation: [subagents](/en/sub-agents)
41 * You hand off independent tasks and check back later: [agent view](/en/agent-view)
42 * Claude plans, assigns, and supervises a group of workers: [agent teams](/en/agent-teams), experimental and disabled by default
43 * A script holds the plan instead of Claude's turn-by-turn judgment: [dynamic workflows](/en/workflows). See [how workflows compare to subagents and skills](/en/workflows#when-to-use-a-workflow)
32* **Do the workers need to talk to each other?** Subagents report results back to the conversation that spawned them, and agent view sessions report only to you. Teammates in an agent team share a task list and message each other directly.44* **Do the workers need to talk to each other?** Subagents report results back to the conversation that spawned them, and agent view sessions report only to you. Teammates in an agent team share a task list and message each other directly.
33* **Do the tasks touch the same files?** Isolate the work with [worktrees](/en/worktrees). Subagents and sessions you run yourself can each use a separate worktree. Agent teams don't isolate teammates in worktrees, so [partition the work](/en/agent-teams#avoid-file-conflicts) so each teammate owns a different set of files.45* **Do the tasks touch the same files?** Isolate the work with [worktrees](/en/worktrees). Subagents and sessions you run yourself can each use a separate worktree. Agent teams don't isolate teammates in worktrees, so [partition the work](/en/agent-teams#avoid-file-conflicts) so each teammate owns a different set of files.
34 46
39* For background sessions, `claude agents` opens [agent view](/en/agent-view): one screen showing every session, its state, and which ones need your input.51* For background sessions, `claude agents` opens [agent view](/en/agent-view): one screen showing every session, its state, and which ones need your input.
40* For subagents in the current session, `/agents` opens a panel with a **Running** tab listing live subagents and a **Library** tab where you [create and edit custom subagents](/en/sub-agents#use-the-%2Fagents-command). Despite the similar name, this is separate from `claude agents`.52* For subagents in the current session, `/agents` opens a panel with a **Running** tab listing live subagents and a **Library** tab where you [create and edit custom subagents](/en/sub-agents#use-the-%2Fagents-command). Despite the similar name, this is separate from `claude agents`.
41* For anything running in the background of the current session, `/tasks` lists each item and lets you check on, attach to, or stop it.53* For anything running in the background of the current session, `/tasks` lists each item and lets you check on, attach to, or stop it.
54* For dynamic workflows, `/workflows` lists running and completed runs, the phase each is in, and how many agents have finished.
42 55
43For a desktop view of all your sessions, see [parallel sessions in the desktop app](/en/desktop#work-in-parallel-with-sessions).56For a desktop view of all your sessions, see [parallel sessions in the desktop app](/en/desktop#work-in-parallel-with-sessions).
44 57
49* [Create custom subagents](/en/sub-agents): define reusable specialists and control which tools they can use.62* [Create custom subagents](/en/sub-agents): define reusable specialists and control which tools they can use.
50* [Manage agents with agent view](/en/agent-view): dispatch sessions, watch their state, and attach when one needs you.63* [Manage agents with agent view](/en/agent-view): dispatch sessions, watch their state, and attach when one needs you.
51* [Orchestrate agent teams](/en/agent-teams): set up a lead and teammates, assign tasks, and review their work.64* [Orchestrate agent teams](/en/agent-teams): set up a lead and teammates, assign tasks, and review their work.
65* [Orchestrate dynamic workflows](/en/workflows): run a bundled workflow or have Claude write one that runs many subagents and verifies their findings against each other.
52* [Run parallel sessions with worktrees](/en/worktrees): start Claude in an isolated checkout, control what gets copied in, and clean up afterward.66* [Run parallel sessions with worktrees](/en/worktrees): start Claude in an isolated checkout, control what gets copied in, and clean up afterward.