Skip to content

Subagents vs Parallel Agents: Claude Code and Git Worktrees

Compare in-session Claude Code subagents with running parallel agents across git worktrees. Trade-offs, when each fits, and a worktree setup for Windows and WSL.

MGMCSA Guru Team June 12, 2026 7 min read
Diagram comparing in-session Claude Code subagents with parallel Claude Code instances across git worktrees

There are two different things people mean by “running agents in parallel” with Claude Code, and they solve different problems. One is in-session subagents — the main thread delegating focused work to helpers that share your working tree. The other is running several Claude Code instances at once, each in its own git worktree on its own branch, doing genuinely separate work.

They’re easy to conflate because both involve more than one agent. But the boundary is sharp: subagents share a working directory and are coordinated by a single main thread; parallel instances are isolated checkouts that you coordinate yourself. Pick the wrong one and you either fight merge conflicts you didn’t need or serialize work that could have run side by side.

This compares the two, lays out the trade-offs, and gives a worktree setup that works on Windows and WSL. If subagents are new to you, the subagents guide covers the basics first.

The two models

Subagents vs parallel instances

In-session subagents
Process One Claude Code session
Working tree Shared
Branch Same branch
Coordination Main thread handles it
Context Isolated per subagent
Best for Coordinated work on one feature

Subagents are about context isolation within a single line of work. The main agent stays in charge, delegates reading or reviewing or testing, and stitches the results together. Everything happens against one working directory and one branch.

Parallel instances are about throughput across independent lines of work. Each runs in its own worktree — a separate checkout of the same repo on its own branch — so three agents can build three unrelated features simultaneously without touching each other’s files.

When subagents fit

Reach for subagents when the work shares a working tree and benefits from a single coordinator. That’s most day-to-day development:

  • Exploring a feature, then planning and editing it in one flow.
  • Writing code on the main thread and delegating review to a reviewer agent.
  • Generating tests for the code you just wrote.

The main thread can fan out to several subagents at once — say, three explorers mapping different parts of the codebase — and because that work is read-only, sharing the working tree is fine. The wins are simplicity (no branch management) and clean context (each subagent’s noise stays out of the main thread).

For which subagents are worth building for this kind of coordinated work, see the best subagents list.

When worktrees fit

Use parallel instances across worktrees when you have several tasks that are genuinely independent — different files, no need to coordinate mid-task. Building an auth feature, a reporting page, and a CLI flag at the same time, for example. Each gets its own worktree, its own branch, its own Claude Code session, and they run without interfering.

The cost is coordination. You own the integration: each branch gets merged back yourself, and overlapping changes can conflict. Token spend also scales with the number of instances, since each session is independent.

Trade-offs at a glance

Concern Subagents
Setup complexity Low
Merge conflicts None (one branch)
True parallel edits No
Cost control Easier (one session)

Setting up git worktrees on Windows and WSL

A worktree is a second working directory attached to the same repository, checked out to a different branch. From inside your repo:

# create a worktree for a new branch in a sibling folder
git worktree add ../myproject-auth -b feature/auth
git worktree add ../myproject-reports -b feature/reports

Each command creates a folder with its own checkout on its own branch. Open a separate terminal in each and start Claude Code there:

cd ../myproject-auth
claude

Now each folder has an independent Claude Code session working on an isolated branch. List and clean up worktrees when you’re done:

git worktree list
git worktree remove ../myproject-auth

On native Windows, the same commands work in PowerShell — just use Windows-style paths:

git worktree add ..\myproject-auth -b feature/auth

That said, running the Claude Code instances inside WSL is usually smoother, because the shell tooling and path handling are more predictable than mixing PowerShell quirks across several sessions. Keep the repo and worktrees on the Linux filesystem rather than reaching across to /mnt/c for better performance. If you haven’t set that up, see the WSL install guide.

For running Claude Code across servers and managing this kind of multi-session setup, the setup for sysadmins covers the operational side.

A worked example: three features at once

Say you’ve got three independent tickets — an auth refactor, a reporting page, and a new CLI flag — and you want them moving in parallel. The worktree setup looks like this:

git worktree add ../app-auth -b feature/auth
git worktree add ../app-reports -b feature/reports
git worktree add ../app-cli -b feature/cli

Open three terminals, start claude in each folder, and brief each session on its ticket. Inside each session, the agent can still use subagents — a context-gatherer to map the relevant code, a reviewer before it wraps up — so you get parallelism across tickets and clean context within each. When a feature is done, commit on its branch, then integrate:

cd ../myproject
git merge feature/cli
git worktree remove ../app-cli

Merge the small, low-conflict branches first to keep integration simple. The two things to watch: branches that touch the same files will conflict, and three live sessions cost roughly three times the tokens of one. That’s the price of throughput.

Managing cost across parallel instances

Subagents keep cost contained because everything runs under one session and you can route exploration to a cheap model. Parallel instances don’t have that built-in ceiling — each is a full session spending independently. A few ways to keep it sane:

Cost control with parallel instances

Tactic Effect
Limit how many instances run at once Caps concurrent token burn
Use subagents inside each instance Routes that instance's exploration to a cheap model
Reserve worktrees for genuinely independent work Avoids wasted re-coordination
Merge and tear down finished worktrees promptly Stops idle sessions lingering

The honest framing: worktrees buy wall-clock speed at the cost of money and coordination overhead. If a job isn’t actually parallelizable, you’re paying both without the benefit.

Decision guidance

A simple way to choose:

  • One feature, want clean context and coordination? Subagents. Let the main thread delegate exploration, review, and tests, and keep everything on one branch.
  • Several independent features, want them built at once? Worktrees. Spin up an instance per branch and accept that you’ll integrate the results.
  • Read-heavy parallel work? Subagents handle this well, even concurrently, because it’s read-only.
  • Concurrent edits to different parts of the codebase? Worktrees, so the agents never share a working tree.

The two aren’t mutually exclusive. A common setup is parallel instances across worktrees, each of which uses subagents internally for review and exploration. That gives you throughput across features and clean context within each one.

Wrapping up

Subagents and parallel instances answer different questions. Subagents isolate context within a single coordinated line of work on one branch — simple, no merge management, ideal for review and exploration. Worktrees give you true parallelism across independent tasks, at the cost of coordinating branches and merges yourself.

Default to subagents for everyday work. Bring in worktrees when you have several genuinely independent features worth building at the same time — and on Windows, run them in WSL for the smoothest experience.

Frequently asked questions

What's the difference between a subagent and a parallel Claude Code instance?

A subagent runs inside one Claude Code session, delegated by the main thread, sharing the same working directory but with its own isolated context. A parallel instance is a separate Claude Code process running in its own git worktree on its own branch — true parallel work on separate files.

When should I use subagents instead of worktrees?

Use subagents when tasks share a working tree and the main thread needs to coordinate the results — code review, exploration, test writing within one feature. They're simpler and need no branch management.

When are git worktrees the better choice?

When you have several independent tasks that touch different files and can run without coordinating mid-task — building three unrelated features at once. Each worktree is an isolated checkout, so the agents don't step on each other.

Do subagents run in parallel?

The main thread can delegate to multiple subagents, and they can run concurrently, but they share one working directory. That makes them well suited to read-heavy parallel work and risky for simultaneous edits to the same files.

What's the main downside of running parallel agents in worktrees?

Coordination and merge conflicts. Several branches changing the codebase at once means you integrate the results yourself, and overlapping changes can conflict. Cost also adds up, since each instance consumes tokens independently.

Can I run git worktrees on Windows?

Yes. Git worktrees work in PowerShell and in WSL. For Claude Code, running the instances inside WSL tends to be smoother because the shell tooling is more predictable, but native Windows works too.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.