Run Agents in Parallel

Claude Code — Beginner-Friendly Teaching Edition
Big idea: Claude Code has several ways to work on multiple tasks at once: subagents, agent view, agent teams, and dynamic workflows. They all use Claude sessions, but they solve different coordination problems.

1. The Main Idea

When a project becomes large, doing everything in one conversation can become slow and difficult to manage. Claude Code lets you split work across multiple workers or sessions. The important question is not simply “Can I run multiple agents?” but: Which parallel approach fits the task?

Subagents Agent view Agent teams Dynamic workflows
Remember: These approaches are different ways of parallelizing Claude work. Choose based on who coordinates the workers, whether workers need to communicate, and whether they touch the same files.

2. Four Ways to Parallelize Work

ApproachWhat it gives youBest use
Subagents Delegated workers inside one session. They perform a side task in their own context and return a summary. Research, exploration, logs, or file inspection that would otherwise flood the main conversation.
Agent view One screen for dispatching and monitoring background sessions. Several independent tasks where you want to hand work off and check status later.
Agent teams Multiple coordinated Claude sessions with a shared task list and inter-agent messaging. Claude should split a project into pieces and coordinate workers.
Dynamic workflows A script can run many subagents and cross-check their results. Large audits, migrations, or research that needs several passes and verification.

3. Subagents

A subagent is a delegated Claude worker running inside the context of your current session. It gets its own context for the side task and returns the useful result to the parent conversation.

Why use a subagent?

  • Keep research results out of the main conversation.
  • Inspect many files without filling the main context.
  • Investigate logs or documentation separately.
  • Delegate a focused task while the main agent continues.
Example: Instead of asking the main Claude session to read 50 files and paste everything into the conversation, delegate the investigation to a subagent and ask it to return only the important findings.

4. Agent View

Agent view is a screen for dispatching and monitoring Claude Code sessions running in the background. It is designed for situations where you have several independent tasks and want to hand them off, watch their status, and step in only when a session needs you.

claude agents

The command opens the agent view, where you can see running sessions and which ones need your input. The documentation currently describes agent view as a Research Preview.

Mental model: Agent view is like a control room for your background Claude sessions.

5. Agent Teams

Agent teams are multiple coordinated Claude sessions managed by a lead. The workers can communicate with each other and share a task list.

Lead Claude Task list Worker A Worker B Worker C

This is useful when a project naturally breaks into several pieces and the workers need to stay coordinated.

Current status: The documentation describes agent teams as experimental and disabled by default.

6. Dynamic Workflows

A dynamic workflow uses a script to run many subagents and cross-check their results. This is useful when a job is too large for a handful of subagents or needs more than one independent pass.

Good examples

  • Codebase-wide audits
  • Large migrations involving hundreds of files
  • Research where findings should be cross-checked
  • Plans that should be evaluated from several angles
Key distinction: In a dynamic workflow, the script holds the plan rather than Claude's turn-by-turn judgment coordinating every worker.

7. Worktrees Are Different

A worktree is not itself an agent type. It is an isolation mechanism. Each worktree gives a Claude session a separate Git checkout so parallel sessions do not edit the same files.

FeaturePurpose
SubagentDelegate a side task inside a session.
Agent viewDispatch and monitor background sessions.
Agent teamCoordinate multiple Claude sessions.
Dynamic workflowRun many subagents through a scripted process.
WorktreeIsolate file changes in separate Git checkouts.
Important: If several workers may edit the same files, use worktree isolation where appropriate.

8. Cross-Session Messaging

Cross-session messaging lets Claude list and message other Claude Code sessions. Those sessions can be on the same machine, another machine, or Claude Code on the web.

This is useful when sessions are independently running but need to pass findings or status to each other.

Think of it like this:
Session A discovers a bug → sends the finding → Session B receives it → Session B continues the fix.

9. /batch

/batch is a skill that packages a particular parallel workflow. It can split one large change into 5 to 30 worktree-isolated subagents, with each subagent opening a pull request.

Important: /batch is not a fifth parallelization model. It is a packaged use of subagents + worktrees.

10. Background Bash Is Not an Agent

A background Bash command can run a shell command without blocking the conversation, but it does not create a Claude agent.

Background BashAgent
Runs a shell command.Runs a Claude session/worker.
No agent reasoning.Can inspect, reason, and perform a delegated task.
Useful for long-running commands.Useful for delegated work.

11. Forked Subagents

A forked subagent is a subagent that inherits the full conversation context instead of starting fresh. It is still a subagent; it is not a separate parallelization category.

The documentation describes /subtask for starting a forked subagent when agent view is enabled. A forked session can also be created with /fork for a background session.

Key idea: Forking changes how context is inherited. It does not change the fundamental role of a subagent.

12. Routines Are Different

A routine runs a Claude session on a schedule in the cloud. That solves scheduled automation rather than parallel work on your machine.

13. How to Choose the Right Approach

Ask three questions.

Question 1 — Who coordinates the work?

  • Claude delegates and collects results in one conversation: use subagents.
  • You hand off independent tasks and check later: use agent view.
  • Claude plans, assigns, and supervises workers: use agent teams.
  • A script should control the process: use dynamic workflows.

Question 2 — Do the workers need to communicate?

  • Subagents report back to the conversation that spawned them.
  • Agent view sessions report results to you.
  • Agent teams allow teammates to communicate directly.
  • Cross-session messaging connects separately running sessions.

Question 3 — Will they edit the same files?

If yes, isolate the work with worktrees or partition the files carefully. Agent teams do not automatically isolate teammates in worktrees, so teammates should own different file areas when sharing a checkout.

14. Checking Running Work

SituationHow to check
Background sessionsclaude agents opens agent view.
Current-session background work/tasks
Named subagentsVisible through the @-mention typeahead with status.
Dynamic workflows/workflows
Version note: In current documentation, /agents is not the command for opening agent view. It prints a notice pointing to subagent file locations. claude agents opens agent view.

15. Parallel Work Costs More

Running several sessions or subagents at once multiplies token usage. Parallelism can save time, but it can also increase usage and rate-limit pressure.

Best practice: Parallelize when the tasks are genuinely independent or large enough to justify the extra workers. Do not create agents simply because you can.

16. Practical Example — Feature + Research

Suppose you are adding OAuth authentication.

Main session → architecture Subagent → inspect existing auth Subagent → research tests Main session → implement

The subagents return concise findings instead of filling the main context with every file and search result.

17. Practical Example — Large Codebase Audit

For a large audit across hundreds of files, a dynamic workflow may be more appropriate. The workflow can divide the repository into jobs, run multiple subagents, and compare their findings.

Large audit
   ↓
Split into jobs
   ↓
Run many subagents
   ↓
Collect findings
   ↓
Cross-check results
   ↓
Produce final report

18. Practical Example — Multiple Independent Tasks

If you have several unrelated tasks that can be handed off independently, agent view is useful.

Task A → Background session
Task B → Background session
Task C → Background session
        ↓
     claude agents
        ↓
Monitor status
        ↓
Step in where needed

19. Common Beginner Mistakes

  1. Thinking all parallel features work the same way.
  2. Using a subagent when you actually need multiple coordinated sessions.
  3. Using agent teams when simple independent background sessions are enough.
  4. Forgetting that worktrees solve file isolation, not agent coordination.
  5. Assuming agent teams automatically isolate teammates' file changes.
  6. Running too many agents and unnecessarily multiplying token usage.
  7. Confusing claude agents with /agents.
  8. Using background Bash and expecting it to behave like an agent.
  9. Using dynamic workflows for a task that only needs one or two simple subagents.

20. Best-Practice Decision Guide

Your situationStart with
One conversation needs a small side investigationSubagent
Several independent jobs need monitoringAgent view
Claude should coordinate multiple workersAgent team
Very large job needs repeated passes and verificationDynamic workflow
Several sessions may edit overlapping filesWorktrees / careful partitioning

21. Interview / Revision Questions

  1. What are the four main parallel approaches in Claude Code?
  2. What is the difference between a subagent and an agent team?
  3. What does agent view provide?
  4. When should you use a dynamic workflow?
  5. What problem do worktrees solve?
  6. Why is cross-session messaging useful?
  7. What is /batch?
  8. Is a background Bash command an agent?
  9. What is a forked subagent?
  10. Why does running many agents increase token usage?
  11. What command opens agent view?
  12. What command lists background work in the current session?

22. Practice — Build Your Parallel-Work Mental Model

  1. Pick a project with at least three independent tasks.
  2. Identify one task that would flood your main context with research and delegate it to a subagent.
  3. Identify two independent tasks you could hand off and monitor later.
  4. Think of a task where multiple workers need to coordinate and map it to agent teams.
  5. Think of a large audit that needs multiple passes and map it to a dynamic workflow.
  6. Ask whether the workers will edit the same files.
  7. If they will, decide where worktree isolation or file partitioning is needed.

23. Quick Memory Map

Subagent = side task Agent view = monitor sessions Agent team = coordinated workers Dynamic workflow = scripted multi-agent process Worktree = file isolation Messaging = sessions communicate /batch = packaged subagents + worktrees

24. Final Takeaway

One-sentence rule:
Use subagents for focused side work, agent view for independent background sessions, agent teams for coordinated workers, and dynamic workflows for large scripted multi-agent jobs. Use worktrees when file isolation matters.

The goal is not to use the maximum number of agents. The goal is to choose the simplest parallel strategy that makes the work faster, cleaner, and easier to verify.

Source: Claude Code official documentation — “Run agents in parallel”. This teaching edition preserves the documentation's current concepts, terminology, comparisons, commands, coordination rules, worktree relationship, monitoring commands, and usage guidance while explaining them in beginner-friendly language.