Parallel AI coding agents in 2026: how to orchestrate multiple Claude Code and Cursor agents without losing context
TL;DR: Running multiple AI coding agents in parallel multiplies throughput — but also multiplies token costs, merge conflicts, and the cognitive load of keeping track of what each agent is doing. Claude Code v2.1.139+ ships four distinct parallelism models, each solving a different problem. The right one depends on whether you want Claude coordinating the work, or you want to dispatch tasks and check back later.
| Subagents | Agent View | Agent Teams | Manual Worktrees | |
|---|---|---|---|---|
| Best for | Side tasks that flood main context | Independent parallel tasks | Complex collaborative work | DIY parallel sessions |
| Coordination | Main Claude delegates | You dispatch, check back | Lead agent manages workers | You coordinate manually |
| Workers talk to each other? | No | No | Yes, directly | No |
| File isolation | Opt-in per subagent | Automatic worktrees | No (you partition files) | Manual |
| Token cost | Low — summary returns to main | Medium — each session independent | ~7× standard session | Standard |
| Status | GA | Research preview (v2.1.139+) | Experimental, off by default | GA |
Honest take: Start with agent view for independent parallel tasks — it gives you visibility without the coordination complexity of agent teams. Save agent teams for genuinely collaborative work where the agents need to challenge each other’s findings.
HN put it clearly: multi-agentic software development is a distributed systems problem. You have workers editing shared state (your codebase), no global clock, and partial failures at any step. The tools shipping in 2026 abstract some of this — but not all of it, and the parts they don’t abstract will hit you when you least expect it.
This is a practical breakdown of what Claude Code’s four parallelism models actually do, tested against the documentation shipped in Claude Code v2.1.139 through v2.1.141 (current as of June 2, 2026).
The four approaches, ranked by complexity
1. Subagents: delegated workers inside one session
A subagent is a specialist that runs in its own context window, does a focused task, and returns only a summary to your main conversation. Use them when a side operation would flood your main session with logs, search results, or file contents you won’t reference again.
# Ask Claude to delegate to a subagent automatically
"Use the Explore agent to find all files that import the auth module, then summarize them"
Expected output: Claude delegates to the built-in Explore subagent (runs Haiku, read-only tools), gets the list, and returns a compact summary — not 3,000 lines of file contents.
Built-in subagents as of v2.1.139:
| Subagent | Model | Tools | When Claude uses it |
|---|---|---|---|
| Explore | Haiku | Read-only | Codebase search, file discovery |
| Plan | Inherits from main | Read-only | Research before planning |
| general-purpose | Inherits from main | All | Complex multi-step operations |
| statusline-setup | Sonnet | Read/Edit | When you run /statusline |
| claude-code-guide | Haiku | Read/WebFetch | Questions about Claude Code itself |
Create custom subagents with /agents, then Library → Create new agent. Store them at .claude/agents/ for project scope or ~/.claude/agents/ for personal scope. The frontmatter structure:
---
name: security-reviewer
description: "Security-focused code reviewer. Use proactively after code changes that touch auth, sessions, or input handling."
model: sonnet
tools: ["Read", "Grep", "Glob", "Bash"]
---
You are a senior security engineer. Focus on OWASP Top 10, injection risks,
and improper session handling. Report findings with severity (critical/high/medium/low).
One hard limitation: subagents cannot spawn other subagents. Plan subagents intentionally cannot spawn more agents (it would cause infinite nesting). If you need workers that communicate, move to agent teams.
2. Agent view: background sessions you dispatch and monitor
Agent view (claude agents) is a single screen for managing multiple independent Claude Code sessions running in the background. Each session is a full conversation — it keeps running whether or not you have a terminal open.
# Open agent view
claude agents
# Or scope it to one project
claude agents --cwd ~/projects/my-app
Inside agent view, type a prompt and press Enter. That launches a new background session. Type another prompt, press Enter again — that’s a second session running in parallel, completely independent. Sessions appear as rows:
Needs input
✻ fix-auth-bug needs input: which token format? 1m
Working
✽ add-payment-api Edit src/payments/stripe.ts 3m
✢ audit-dependencies run 4 · 12 packages scanned in 2m
Completed
∙ write-test-suite result: 47 tests added, all passing 8m
Navigation:
Spaceon a row: peek at the session’s latest output or questionEnter/→: attach to the session (full terminal takeover)←on empty prompt while attached: detach, return to agent view tableCtrl+Xtwice: stop and delete a session
Agent view automatically gives each background session its own git worktree, so parallel sessions never edit the same files. When you dispatch a session from claude agents, the session works in an isolated checkout and merges back when done. No manual worktree setup required.
This requires Claude Code v2.1.139 or later. Check with claude --version.
3. Agent teams: workers that talk to each other
Agent teams are the highest-power option and the most expensive one. A lead agent coordinates a group of teammate sessions, each running in its own context window, with a shared task list and direct inter-agent messaging.
Enable it first — it’s off by default:
// settings.json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Requires Claude Code v2.1.32 or later.
Then spawn a team:
Create an agent team to investigate this performance regression.
Spawn three teammates: one profiling the database queries, one analyzing
the rendering pipeline, one checking network request batching. Have them
share findings and challenge each other's conclusions.
The lead creates a shared task list, spawns the teammates, and coordinates via a messaging mailbox. Teammates can claim tasks from the shared list, message each other directly by name, and report findings back to the lead. Use Shift+Down to cycle through teammates in in-process mode.
The catch: agent teams use approximately 7× more tokens than a standard session (Anthropic’s documented figure for plan-mode teammates). Each teammate is an independent Claude instance with its own context window. For a 5-teammate team running complex tasks, that’s real money.
Best use cases per the documentation: parallel code review across distinct domains, debugging competing hypotheses (deliberately adversarial), and new module work where each teammate owns a separate file set. Avoid using teams when tasks touch the same files — there’s no automatic file isolation, and two teammates editing the same file causes overwrites.
4. Git worktrees: the DIY approach
Before all the orchestration tooling existed, developers ran parallel Claude sessions in separate git worktrees. This still works, gives you maximum control, and is the right choice when you want to manage the parallelism yourself without an orchestrator:
# Start first isolated session on a new branch
claude --worktree feature-payment-api
# In another terminal, start a second isolated session
claude --worktree bugfix-session-timeout
# List your worktrees
git worktree list
Each --worktree call creates a checkout under .claude/worktrees/<name>/ on a branch named worktree-<name>, starting from origin/HEAD by default. Add .claude/worktrees/ to .gitignore.
One friction point: worktrees are fresh checkouts, so .env and other gitignored local files aren’t present. Fix it with .worktreeinclude:
# .worktreeinclude (in project root)
# Files matching these patterns + gitignored = copied into each new worktree
.env
.env.local
config/secrets.json
Claude Code reads this file automatically when creating any worktree (via --worktree, subagent worktrees, or background sessions).
The practical workflow: three parallel agents on one feature
Here’s a workflow that works with agent view, applied to building a new billing module:
# Open agent view
claude agents
Then dispatch three tasks as separate prompts (each press of Enter creates a new session):
"Implement the Stripe webhook handler in src/payments/webhooks.ts. Handle checkout.session.completed and payment_intent.payment_failed events. Write unit tests.""Review the existing billing data model in src/models/ and write a migration to add a billing_status column to users table. Check for any FK constraints.""Audit src/payments/ for any hardcoded API keys, insecure logging of card data, or missing error handling. Report with severity levels."
All three run in separate worktrees simultaneously. You stay in agent view, watching the row summaries update every 15 seconds. When one asks a question (Needs input row, yellow icon), hit Space to peek and reply without leaving the dashboard.
When all three complete, attach to each session in sequence (Enter) to review diffs, merge the branches, and resolve any conflicts between the migration and the webhook handler.
This entire workflow requires no manual worktree setup and no orchestration code. The context management overhead is zero — each session has its own isolated context that doesn’t pollute the others.
The token cost math you need to do first
Running agents in parallel multiplies token usage. The numbers from Anthropic’s documentation:
| Setup | Relative token cost | Notes |
|---|---|---|
| Single Claude Code session | 1× baseline | Standard |
| Agent view (3 background sessions) | ~3× | Each session independent |
| Agent teams (3 teammates, plan mode) | ~7× per teammate vs single session | Coordination overhead adds up |
| Subagents (summaries back to main) | Lower than 1× per task | Only summaries enter main context |
Enterprise deployments report an average of approximately $13 per developer per active day and $150–$250 per developer per month across all Claude Code usage. 90% of users stay under $30 per active day. Running three background sessions in agent view for a full workday puts you above average — factor that in before deploying this to a team.
Rate limit recommendations for teams (token per minute per user):
| Team size | TPM per user |
|---|---|
| 1–5 | 200k–300k |
| 5–20 | 100k–150k |
| 20–50 | 50k–75k |
| 50–100 | 25k–35k |
If you hit rate limits with parallel sessions, the sessions queue rather than fail — but your throughput drops. Set workspace-level limits in the Claude Console before running large parallel workloads.
Where Cursor fits in
Cursor’s background agent feature lets you dispatch coding tasks that run remotely while you keep working in the editor. It’s the IDE-side equivalent of agent view — you stay in Cursor, kick off a task, and check on it when it’s done.
The architectural difference matters: Claude Code’s parallel models run as terminal sessions with full file system access and git integration built in. Cursor’s background agent runs in Cursor’s managed environment. If your team is already in Cursor for day-to-day work, the background agent is the lower-friction option — no terminal switching, visual diffs inline. If you’re orchestrating complex multi-agent workflows or running CI-adjacent pipelines, Claude Code’s agent view and worktree integration give more control.
Neither approach solves the fundamental distributed systems problem — you still have to partition work so agents don’t write to the same files simultaneously. Agent view does this automatically via worktrees. Cursor’s background agent isolation depends on its environment. When in doubt, assume any two agents editing the same file at once will cause a conflict.
Failure modes to plan around
Subagents can’t spawn subagents. The Plan built-in subagent specifically cannot create child agents — it’s intentional to prevent infinite nesting. If you need deep orchestration, use agent teams or agent view.
One team at a time. A lead session can manage exactly one agent team. Clean up the current team before creating a new one.
File conflicts in agent teams. Agent teams don’t give each teammate a worktree. If you spawn three teammates to “improve code quality,” they’ll race to edit overlapping files. Explicit file ownership in the spawn prompt: “teammate A owns src/auth/, teammate B owns src/payments/, teammate C owns tests/” prevents this.
Session state after shutdown. Background sessions show as failed after a machine shutdown. Recover them with claude --resume using the session’s history — the conversation persists on disk even after the process exits.
Context ceiling per teammate. Each Claude Code session has a 200K token context window. Long-running agent team sessions will hit compaction. For research tasks this is fine; for sessions making interdependent code changes, it can cause teammates to “forget” earlier decisions. Keep spawn prompts focused and scope each teammate’s work to 1–3 hours of effort.
Frequently Asked Questions
Can I run agent teams and agent view simultaneously? Yes. Agent view manages background sessions; agent teams spawn within a session. You can have multiple background sessions in agent view, each of which could theoretically be running its own agent team — though the token costs scale proportionally.
Do subagents share my CLAUDE.md instructions? Yes, with two exceptions: the Explore and Plan built-in subagents skip CLAUDE.md and the parent session’s git status to stay fast and cheap. All custom subagents load CLAUDE.md from the working directory.
What happens to background sessions when I close my terminal? They keep running. A separate supervisor process hosts background sessions, so you can close your terminal, close agent view, or start other sessions. Sessions resume when you open agent view again.
Is it safe to have multiple agents commit to the same branch? No. Use separate worktrees (automatic with agent view) or give each agent its own branch explicitly. Concurrent commits to the same branch from separate processes cause race conditions in git history.
How do I keep token costs under control with parallel agents?
Use Sonnet for teammates instead of Opus. Clear sessions between unrelated tasks with /clear. Route verbose side tasks (log analysis, documentation fetch) through subagents so only summaries reach your main session. Set a monthly spend limit with /usage-credits if you’re on a Pro or Max plan.
Sources
- Claude Code: Run agents in parallel — Official docs
- Claude Code: Create custom subagents — Official docs
- Claude Code: Manage multiple agents with agent view — Official docs
- Claude Code: Orchestrate teams of Claude Code sessions — Official docs
- Claude Code: Run parallel sessions with worktrees — Official docs
- Claude Code: Manage costs effectively — Official docs
- Claude Code: Overview — Official docs
Last updated June 2, 2026. Claude Code features marked “research preview” or “experimental” may change without notice; verify against the official docs before building workflows on top of them.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.