Claude Code v2.1.139+ provides four parallel execution models — Subagents, Agent View, Agent Teams, and Manual Worktrees — each suited to different coordination patterns. The choice depends on whether the user wants Claude to coordinate work (Agent Teams), dispatch independent tasks and check later (Agent View), offload side tasks cheaply (Subagents), or manually control isolated checkouts (Git Worktrees). Token costs vary significantly across models, and file isolation must be managed explicitly to avoid conflicts.
Key Points
Subagents run in their own context window, return only a summary to the main session, and cannot spawn further subagents. They are the cheapest option per task.
Agent View (claude agents) manages multiple independent background sessions from a single terminal screen. Sessions get automatic git worktrees; no manual setup needed.
Agent Teams (experimental) let a lead agent coordinate teammates with shared task lists and inter-agent messaging. Each teammate uses its own context window; no automatic file isolation. Enable with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
Manual Git Worktrees (claude --worktree <name>) create isolated checkouts under .claude/worktrees/. Use .worktreeinclude for shared gitignored files.
Token costs: single session = 1× baseline; Agent View with 3 sessions ≈ 3×; Agent Teams (3 teammates, plan mode) ≈ 7× per teammate vs. single session; Subagents cost less than 1× per task because only summaries enter the main context.
File conflicts are a risk with any parallel model. Agent View isolates worktrees automatically; Agent Teams require explicit file ownership in spawn prompts; manual worktrees rely on branch discipline.
Background sessions persist across terminal closures; recovery with claude --resume. Shutdown leaves sessions as “failed” until resumed.
Context ceiling per teammate is 200K tokens; long-running team sessions may hit compaction. Keep spawn prompts focused and scope each teammate’s work to 1–3 hours.
Concepts
Subagent: A specialised agent that runs in its own context window, uses a restricted or full tool set, and returns only a summary. Built-in subagents include Explore, Plan, general-purpose, statusline-setup, and claude-code-guide. Custom subagents are defined via frontmatter files in .claude/agents/ (project) or ~/.claude/agents/ (personal). They cannot spawn other subagents.
Agent View: A full-screen terminal interface (claude agents) that lists background sessions. Each row shows status (needs input, working, completed). Sessions run independently in their own git worktrees. Navigation: Space peeks, Enter/→ attaches, ← on empty prompt detaches, Ctrl+X twice stops/deletes. Sessions update every 15 seconds.
Agent Teams: A lead agent controls up to several teammate sessions, each with a dedicated context window. Teammates share a task list and can message each other. Off by default; requires v2.1.32+. Use cases: parallel code review, competing debug hypotheses, multi-module ownership. A lead session can manage exactly one team at a time.
Git Worktrees (Manual): claude --worktree <name> creates a linked working tree on branch worktree-<name> under .claude/worktrees/. Add that path to .gitignore. The .worktreeinclude file in the project root copies listed gitignored files into each new worktree.
Details
Claude Code offers four distinct parallelism models, each optimised for a different coordination pattern. Subagents are the lightest: a subagent runs a single task in its own context window, then returns a concise summary to the parent session. Because the main conversation never sees intermediate tool calls or large outputs, token costs remain low—often less than a single synchronous task. Built-in subagents vary in model and tool access: Explore uses Haiku and is read-only; Plan inherits the parent’s model and is read-only; general-purpose inherits the model and has full tools; statusline-setup uses Sonnet with read/edit; claude-code-guide uses Haiku with read and web fetch. Custom subagents are created via the /agents command, navigating to Library → Create new agent. Their definitions are stored as frontmatter YAML (with fields name, description, model, tools, and a system prompt) in .claude/agents/ for project-wide use or ~/.claude/agents/ for personal use. Subagents load CLAUDE.md from the working directory, except the Explore and Plan built-ins which skip it for speed. A critical limitation: subagents cannot spawn subagents, preventing infinite nesting; for deeper orchestration, use Agent Teams or Agent View.
Agent View (claude agents) transforms the terminal into a dashboard for independent background sessions. Each session is a full Claude Code conversation with its own git worktree—no manual setup required. The user dispatches tasks by typing a prompt and pressing Enter from the Agent View prompt line. The interface shows rows with coloured status indicators: yellow with a prompt means “Needs input”, a file icon means “Working”, and a checkmark summarizes a completed session. Navigation is keyboard-driven: Space peeks into a session without fully attaching, Enter or → attaches to it, ← on an empty prompt detaches from the current session, and Ctrl+X twice stops and deletes the session. Background sessions continue running even when the terminal is closed, because a separate supervisor process manages them. If a machine shuts down, sessions appear as failed; they can be recovered with claude --resume (the conversation persists on disk). The practical workflow for a billing module, for example, involves dispatching three tasks—Stripe webhook handler, database migration, and security audit—as separate prompts. All three run simultaneously in isolated worktrees. The user stays in Agent View, watches rows update every 15 seconds, responds to “Needs input” via Space, and when all complete, attaches to each session to review diffs, merge branches, and resolve conflicts.
Agent Teams (experimental, enabled via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, requires v2.1.32+) provides a lead-agent orchestration model. A lead session coordinates teammate sessions, each in its own context window, using a shared task list and direct inter-agent messaging. This model is suited for tasks like parallel code review across domains, debugging competing hypotheses, or building a new module where separate teammates own different files. One limitation: a lead session can manage exactly one team at a time—the current team must be cleaned up before creating another. Token costs are substantial: approximately 7× more tokens per teammate compared to a single session when using plan mode, because each teammate’s full context and decision-making is active. There is no automatic file isolation within Agent Teams; two teammates editing the same file will cause overwrites. Explicit file ownership should be specified in the spawn prompt (e.g., “teammate A owns src/auth/, teammate B owns src/payments/”). Each Claude Code session has a 200K token context window, so long-running team sessions may hit compaction, causing teammates to forget earlier decisions. Keeping spawn prompts focused and scoping each teammate’s work to 1–3 hours mitigates this.
Manual Git Worktrees (claude --worktree feature-payment-api) offer a DIY parallel model. The command creates an isolated checkout under .claude/worktrees/<name>/ on a branch worktree-<name>. The directory .claude/worktrees/ should be added to .gitignore. Developers can use a .worktreeinclude file in the project root to automatically copy gitignored files (like .env) into new worktrees. This model is less automated than Agent View but gives full control.
Token cost management is critical when running parallel agents. Enterprise deployments average ~$13 per developer per active day, with 90% of users staying under $30/active day. Parallel models burn credits faster: Agent View with three sessions roughly triples token consumption, while Agent Teams with three teammates in plan mode can consume seven times the tokens of a single session. Recommendations for rate limits (tokens per minute per user): 1–5 users: 200k–300k; 5–20: 100k–150k; 20–50: 50k–75k; 50–100: 25k–35k. When rate limits are hit, sessions queue rather than fail. To control costs, use Sonnet instead of Opus for teammates, clear sessions between unrelated tasks with /clear, route verbose side tasks through subagents so only summaries enter the main session, and set monthly spend limits with /usage-credits on Pro or Max plans.
Frequently asked questions
Can I run agent teams and agent view simultaneously? Yes. Agent View manages background sessions; Agent Teams spawn within a session. Multiple background sessions can each run their own team, though token costs scale proportionally.
Do subagents share my CLAUDE.md instructions? Yes, except Explore and Plan built-ins skip CLAUDE.md (and git status) for speed. Custom subagents always load CLAUDE.md.
What happens to background sessions when I close my terminal? They keep running under a separate supervisor process. Closing the terminal or Agent View does not stop them; they resume when you open Agent View again.
Is it safe to have multiple agents commit to the same branch? No. Always use separate worktrees (automatic with Agent View) or give each agent its own branch. Concurrent commits from separate processes cause race conditions.
How do I keep token costs under control? Use Sonnet for teammates, clear sessions between tasks, route verbose tasks through subagents, and set monthly spend limits with /usage-credits.
Comparison to Cursor’s background agent: Cursor’s background agent runs remotely without terminal switching and shows inline visual diffs, making it lower-friction for day-to-day editing. Claude Code’s models run as terminal sessions with full filesystem access and git integration, offering more control for complex multi-agent or CI-adjacent pipelines. Neither approach eliminates the fundamental distributed systems problem: any two agents editing the same file at the same time will cause a conflict. Agent View handles this automatically via worktrees; Cursor’s isolation depends on its managed environment.
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.