DEV Community

Jovan Chan
Jovan Chan

Posted on • Originally published at aicoderscope.com

Parallel AI coding agents in 2026: how to orchestrate multiple Claude Code and Cursor agents without losing context

This article was originally published on aicoderscope.com

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"
Enter fullscreen mode Exit fullscreen mode

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).
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Navigation:

  • Space on a row: peek at the session's latest output or question
  • Enter / : attach to the session (full terminal takeover)
  • on empty prompt while attached: detach, return to agent view table
  • Ctrl+X twice: 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"
  }
}
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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 g

Top comments (0)