aq.dev / guides / run-multiple-claude-code-sessions-in-parallel

How to Run Multiple Claude Code Sessions in Parallel

To run multiple Claude Code sessions in parallel, give each session its own git worktree and branch so the sessions never edit the same files. Claude Code does this itself: claude --worktree feature-auth (or -w) starts a session in a new worktree, and running it again with another name in a second terminal starts a second isolated session. For a team, AQ does the same on a shared machine, one worktree and branch per work item, with each session visible to the teammates you share it with.

On AQ, each Claude Code session gets its own isolated git worktree and branch, so many run at once without colliding, and teammates can watch them live.

What Anthropic's docs say

Anthropic's guide Run parallel sessions with worktrees is the reference for the local setup, and the same section appears in Common workflows. In short, as checked November 13, 2026:

  • claude --worktree <name> creates the worktree under .claude/worktrees/<name>/ at the repository root, on a new branch named worktree-<name>, branched from the default branch. Leave out the name and Claude picks one. The docs suggest adding .claude/worktrees/ to .gitignore.
  • A new worktree has no gitignored files. List the ones to copy, such as .env, in a .worktreeinclude file; dependencies you install yourself, or ask Claude to.
  • On exit, a clean unnamed worktree is removed with its branch; one with work in it prompts you to keep or remove it, and claude --worktree <name> --resume picks it back up. Non-interactive -p runs are not cleaned up.
  • Inside one session, subagents can each get a temporary worktree (isolation: worktree in a custom subagent), and claude --bg --worktree starts a background session.

That covers one developer on one machine well. Read it first; the rest of this page is about what it does not cover.

Why run Claude Code sessions in parallel?

Parallel sessions pay off when you have independent tasks, not one task you want to split. Claude Code spends most of its wall-clock time reading files, running tests and waiting on tool calls. While one session works through a migration, a second can fix an unrelated bug and a third can write tests for last week's feature. Pointing several sessions at the same files does not work: two agents editing one module produce conflicts and test failures neither caused. Parallelize across tasks, never within one.

What the docs leave to you

Run three or four worktree sessions for a week and these questions come up. None of them is about Claude Code itself; they are about the machine and the people around it.

  • Setup per worktree. Each worktree needs its own dependency install, env files and often a seeded database before the agent can run tests.
  • Ports. Two dev servers both want port 3000, and you end up assigning ports by hand and forgetting which preview belongs to which branch.
  • Laptop lifetime. Sessions run while your machine is awake. Close the lid and the runs stop, unless they live on a server you keep up.
  • Teammates. Nobody else can see that a session is running, what it is doing or whether it is stuck, and handing one over means screen sharing or pushing half-finished work.
  • Review. Every session ends in a diff someone has to read, and a branch someone has to own.

For one person running two sessions, a terminal multiplexer such as tmux, or Herdr (herdr.dev), an open source multiplexer for agents that shows which sessions are working, blocked or done, is enough. The gaps compound for a team running many.

How AQ runs parallel Claude Code sessions for a team

AQ keeps the same model, one worktree and branch per task, and runs it on a machine instead of your laptop. Each task is a work item:

  • AQ creates the worktree and its branch (named ai/{id}-{slug}), installs dependencies and runs your repository's setup command, with the output in the work item's Log tab.
  • Claude Code runs on your own connected Claude account, in a conversation tied to that work item. Codex, OpenCode and other CLIs work the same way, so different work items can use different agents.
  • Each work item gets its own preview address and its own block of ports, so dev servers do not collide.
  • On a cloud machine (the AQ Pro plan includes one), sessions keep running when you close your laptop, and you pick them up from any browser. On the Free plan, agents run on your own Mac with the AQ Mac app.
  • The Changes panel shows each work item's diff, with line comments and merge. Marking the work item done removes its worktree.

Work items start private. Share one with a teammate and they see the same conversation, changes and preview as it updates, and can message the agent; a message they send runs on their own subscription unless you let them drive yours.

How many parallel sessions should you run?

Fewer than you think. The binding constraint is your review bandwidth, not compute: every session produces diffs to read and a branch to own. Most engineers settle at two to four active sessions, one you are steering and one or two working on longer tasks. Starting a fifth before you have reviewed the first one's output does not increase throughput; it grows the pile.

Quick comparison

Concernclaude --worktree on your machineAQ work items
Isolation per taskWorktree + branch per sessionWorktree + branch per work item
Dependencies and env files.worktreeinclude, install yourselfSetup command and install run for you
Dev-server portsAssign by handOwn ports and preview address per work item
Session lifetimeWhile your machine is awakeKeeps running on a cloud machine
Teammate visibilityNoneShared work items, watched live
CleanupExit prompt, or git worktree removeRemoved when the work item is done

Start with claude --worktree; it is free and teaches the isolation model. When setup, ports or "what is your agent doing?" messages start costing real time, move the sessions somewhere your team can see them.

Frequently asked questions

How do I run multiple Claude Code sessions in parallel?

Start each session in its own git worktree so they never edit the same files: claude --worktree feature-auth in one terminal and claude --worktree bugfix-123 in another, per Anthropic's worktrees guide. For a team, AQ gives each Claude Code session its own isolated git worktree and branch on a shared machine, so many run at once without colliding, and teammates can watch them live.

How do I manage multiple Claude Code sessions at once?

Give every session its own git worktree and its own terminal pane, then track state per session: which is waiting on you, which is working, which is done. Locally that is tmux discipline (or a multiplexer for agents like Herdr); on AQ each session belongs to a work item with its own branch, preview and conversation, and the teammates you share it with can follow it live.

Can I run multiple Claude Code instances at the same time?

Yes. Claude Code has no single-instance limit: each instance is just a process in its own directory. The practical constraints are your plan's rate limits, your machine's memory, and your own review bandwidth. Keep instances in separate worktrees so they never edit the same files.

Can I run multiple Claude Code sessions in the same directory?

You can, but you should not. Two sessions editing one working tree overwrite each other's changes and corrupt each other's test runs. Give each session its own git worktree (claude --worktree <name>, or a work item on AQ) so every session has private files and a private branch.

How many Claude Code sessions can I run at once?

Technically as many as your machine or server can hold; practically, two to four. The limit is review bandwidth, not compute: every session produces output you must read and a PR you must own. Add sessions only when you are keeping up with reviewing the ones you have.

Do parallel sessions share one Claude subscription?

Yes. Claude Code sessions authenticate with your Anthropic account, and parallel sessions draw from the same usage limits. On AQ, Claude Code runs on each person's own connected Claude account rather than a shared API key, so usage stays with the person running the session.

What happens to a local session when I close my laptop?

It stops. Claude Code runs in your terminal's process tree, so sleep or shutdown kills the run unless you use tmux on a remote machine. On AQ with a cloud machine (your own VM or an AQ-managed one, on the Pro plan), sessions keep running when you disconnect and are live when you return.

Should I split one large task across multiple parallel sessions?

No. Parallel sessions work for independent tasks with independent branches. Splitting one task across agents creates merge conflicts and coordination overhead that erases the speedup. For a large task, run one session and break the work into sequential steps instead.