Course contents
Parallel Work: Worktrees, Background Agents and Agent Teams
Run several Claude sessions at once without collisions: give each a worktree, dispatch background agents from agent view, and know when an agent team or a dynamic workflow is worth its cost.
It's tempting to think that four agents finish four times faster. Before reading about the tools, explore where the time actually goes when several agents work and one person reviews.
Start with 4 agents, 30-minute tasks and 10-minute reviews. Then push the number of agents up.
Move the controls and watch what changes.
With 30-minute tasks and 10-minute reviews, what's the most speed-up you can ever get by adding agents?
Worktrees: one checkout per session
Two sessions editing the same files will trip over each other. A git worktree is a second working directory with its own branch, sharing one repository. claude --worktree feature-auth (or -w) creates .claude/worktrees/feature-auth/ on a new branch called worktree-feature-auth and starts Claude there; run it again with another name in another terminal for a second isolated session. Add .claude/worktrees/ to your .gitignore.
A worktree is a fresh checkout, so gitignored files such as .env aren't there and dependencies aren't installed. List the small files you need in a .worktreeinclude at the repository root (same syntax as .gitignore) and Claude Code copies them into each new worktree. Don't list node_modules: it copies rather than links. When you exit an unnamed worktree session with no changes, Claude Code removes it; otherwise it asks. A claude -p --worktree run exits without asking, so you clean those up with git worktree remove.
Start an isolated session for the auth work, and make sure each new worktree gets your local environment file.
Five ways to run agents in parallel
| Approach | What you get | Status as of November 2026 |
|---|---|---|
| Subagents | Workers inside one session that return summaries | Built in; Claude uses them on its own |
Agent view (claude agents) | One screen to dispatch and watch background sessions on your machine | Research preview |
| Agent teams | A lead session that assigns work to teammates who share a task list and message each other | Experimental, off by default |
| Projects | One ongoing conversation at claude.ai/code or in the desktop app; Claude starts and tracks parallel cloud threads | Public beta on Pro, Max and Ultra |
| Dynamic workflows | A script Claude writes that orchestrates dozens or hundreds of subagents and cross-checks their results | All paid plans; on Pro, turn it on in /config |
Background agents. Run claude agents to open agent view: type a task and press Enter to dispatch a background session, and each new prompt starts another one. Rows show which sessions are working, which need your input and which are done; you can peek, reply or attach to the full conversation. Each dispatched session moves into its own worktree before it edits files. From inside a session, /background (or /bg) sends the current conversation to the background, and /fork sends a copy while you keep working. From your shell, claude --bg "<task>" dispatches directly.
Agent teams are for work where the workers need to talk: research where teammates challenge each other's findings, or a feature split across frontend, backend and tests. You turn them on with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. They use significantly more tokens than one session, and the docs recommend a single session or subagents for sequential work, same-file edits or tasks with many dependencies. For one large mechanical change, /batch packages subagents and worktrees for you: it plans 5 to 30 independent units and has each open a pull request.
Match each job to the approach that fits.
Pick one on the left, then its partner on the right.
Why not dispatch twelve background sessions for every task?
.env is missing. What's the fix?Plain-English definitions from the AI Coding Dictionary.