Code Tycoon Get Code Tycoon

Blog / Sessions

How to Run 5 Claude Code Sessions in Parallel Without...

Run five Claude Code sessions at once without overwriting each other: git worktrees, one task per session, usage limits and tools. Checked in Nov 2026.

How to Run 5 Claude Code Sessions in Parallel Without...

Five sessions work fine side by side if each one has its own checkout, its own branch and its own task. The setup takes about ten minutes. The part that costs people time is everything after: merging, watching, and staying inside your usage limits.

Table of contents

Introduction

Running one Claude Code session is simple. Running five is a different job. You are no longer waiting on the agent; the agents are waiting on you, and they are all pointed at the same repository unless you stop that.

This guide shows how to run five sessions at once on one machine, with commands from the Claude Code and git documentation. It covers the isolation setup, how to keep track of what each session is doing, what happens to your usage limits, and the order in which to merge. It is a how-to built from the documentation and from our own Claude Code transcripts, with the method stated in the data section.

We run parallel sessions every day. Nothing in the steps below needs a dedicated tool, Code Tycoon included. Where another tool does a step better, we say so.

The short version, if you only want the commands:

# in the repo root, with at least one commit
claude --worktree feature-auth     # terminal 1
claude --worktree fix-billing      # terminal 2
claude --worktree docs-update      # terminal 3
claude --worktree migrate-logger   # terminal 4
claude --worktree test-flaky       # terminal 5

The Claude Code docs describe it this way: "Pass --worktree or -w with a name to create a worktree and start Claude in it" (Claude Code worktrees docs, checked 2026-11-23). The rest of this article is about making those five terminals useful.

What actually collides

"Collision" is used loosely, so it helps to separate four different things that go wrong when sessions share a machine.

Files in one working directory. If two sessions run in the same checkout, they read and write the same files on disk. Session A edits config.ts, session B edits it a minute later from its own picture of the file, and one change is lost or the file ends up half of each. This is the problem worktrees solve.

Branches. Two sessions on one branch commit on top of each other. Even with separate files, the history becomes a mix of two tasks, and reverting one task means untangling it from the other. Git blocks the simplest version of this for worktrees: git worktree add "refuses to create a new worktree when <commit-ish> is a branch name and is already checked out by another worktree" unless you pass --force (git-worktree docs).

Things outside git. A worktree isolates tracked files. It does not isolate a dev server port, a local database, a node_modules folder you share by symlink, a cache directory or a lock file in your home folder. Two sessions that both run npm run dev on port 3000 collide even though their code does not. These failures are often blamed on Claude, and they are ordinary resource conflicts.

Shared limits. Five sessions draw from one plan. Anthropic's help center says "Pro and Max plans have a five-hour session limit and a weekly limit" and that "these limits are shared across Claude and Claude Code" (Using Claude Code with your Pro or Max plan). The Claude Code agent view docs add that each background session "uses your subscription quota independently" (agent view docs). Five sessions can use the allowance roughly five times as fast, so the limit is a collision too.

The rest of the guide takes these four in turn.

Step 1: split the work into five independent tasks

Isolation does not fix a bad split. If task 2 depends on the output of task 1, running them at once just produces two sessions that disagree.

Before you start anything, write the five tasks in one sentence each and check three things:

  1. Different files. List the two or three files or folders each task will touch. If two tasks share a file, they will conflict at merge time even in separate worktrees. Either merge the tasks, or sequence them.
  2. Different ends. Each task should finish in its own pull request. A task that "also tidies up some things" will touch files owned by another session.
  3. No hidden dependency. A shared type definition, a schema, a lockfile or a generated file is the usual hidden dependency. If one task changes the dependencies in package.json, assume every other task is affected.

A useful rule for the first week is to run three sessions, not five, and add sessions only when your review keeps up. Five sessions that finish faster than you can read their diffs give you a pile of unreviewed work, not extra output. The views on the home page show one way to look at what each session changed.

Step 2: give each session its own worktree

A git worktree is a second checkout of the same repository. The git documentation says "A git repository can support multiple working trees, allowing you to check out more than one branch at a time" (git-worktree). The checkouts share one object store and one set of refs, so five worktrees cost far less disk than five clones.

You have two ways to create them.

Option A: let Claude Code create them

claude --worktree feature-auth

Claude Code creates the worktree under .claude/worktrees/feature-auth/ on a branch named worktree-feature-auth and starts a session inside it (worktrees docs). The common-workflows page puts the second step plainly: "Run the same command with a different name in a second terminal to start an isolated parallel session" (common workflows).

Two details from the docs matter. The repository needs at least one commit first, because a worktree is created from an existing commit. And you should add .claude/worktrees/ to your .gitignore, so the checkouts do not show up as untracked files in the main one.

On exit, Claude Code checks for uncommitted or unpushed work before it removes a worktree, which protects you from deleting a session's only copy of its changes.

Option B: create them yourself

git worktree add ../app-feature-auth -b feature-auth
git worktree add ../app-fix-billing -b fix-billing
git worktree add ../app-docs-update -b docs-update
git worktree add ../app-migrate-logger -b migrate-logger
git worktree add ../app-test-flaky -b test-flaky

cd ../app-feature-auth && claude

The git docs give the same shape: git worktree add ../hotfix "creates new branch hotfix and checks it out at path ../hotfix." Creating them yourself means you choose the folder and the branch name, which matters if you use a tool that expects a pattern (ccmanager builds worktree paths from a pattern with a {branch} placeholder, per its README).

Whichever you pick, name the branch after the task, not after the session number. session-3 means nothing in a week. fix-billing does.

One caution from the git docs: "Multiple checkout in general is still experimental, and the support for submodules is incomplete. It is NOT recommended to make multiple checkouts of a superproject." If your repository uses submodules, use separate clones for the sessions instead. Clones from a local path hardlink the object files where possible, so the disk cost is still modest (git-clone docs).

Step 3: carry over the files git does not track

A new worktree contains only tracked files. It has no .env, no local config, no certificates and no node_modules. A session that starts without them fails in confusing ways: the app will not start, tests need a secret, and Claude spends tokens trying to diagnose a missing file.

Claude Code has a documented fix: a .worktreeinclude file in the repo root, listing gitignored files to copy into each new worktree, using gitignore syntax (worktrees docs). A minimal one looks like this:

.env
.env.local
config/local.json

ccmanager has the same idea. Its README describes .worktreeinclude (gitignore syntax) copying gitignored files such as .env into new worktrees (ccmanager README).

Dependencies are your call. Running npm install in each worktree is slow but safe. Sharing one node_modules through a symlink saves time and breaks the moment two tasks change dependencies. For the first week, install in each one.

Now deal with the resources that live outside git:

  • Ports. Give each worktree its own dev port through an environment variable, for example PORT=3001 through PORT=3005. List them in a file you copy in.
  • Databases. Point each session at its own database name or its own SQLite file. If five sessions run migrations against one local database, the schema belongs to whichever session ran last.
  • Generated output. Build folders, caches and lock files in a shared location need a per-worktree path.

None of this is Claude-specific. It is the same setup you would need if five people were working on the repo from one machine.

Step 4: start the five sessions and keep them in view

Starting is the easy part. Five terminal tabs work. The trouble is knowing which one needs you.

Claude Code has a built-in view for this. Agent view, opened with claude agents, is "one screen for all your background sessions: what's running, what needs your input, and what's done," with the states Working, Needs input, Idle, Completed, Failed and Stopped. The docs label it a research preview (agent view docs), so expect it to change.

If you prefer a terminal multiplexer, tmux gives you one window per session and a status bar. For running sessions on a server so they survive a closed laptop, see how to run Claude Code on a server.

The practical habits matter more than the tool:

  1. Name each session after its task, so the tab or window says what it is.
  2. Write the task and its boundary in the first prompt. "Only change files under billing/. If you need a change elsewhere, stop and ask." This is the cheapest collision guard there is.
  3. Check on a schedule. Look at all five when you finish reading a diff, not whenever one finishes.
  4. Answer questions fast. A session that is waiting on you is not working. Five sessions with three of them blocked is one and a half sessions.

Many people also relax the permission prompts so sessions do not stop on every command. That is a separate decision with its own risks, covered in the Claude Code docs, and not something to switch on casually across five sessions that each run shell commands.

Step 5: merge in a deliberate order

Worktrees move the conflict from edit time to merge time. That is an improvement, because a merge conflict is visible and a silent overwrite is not, but it does not make the conflict go away.

A merge order that holds up:

  1. Merge the smallest, most independent branch first. It will not conflict, and it shrinks the diff for the rest.
  2. Rebase the next branch onto the updated main before you review it, so you read the diff against the code it will land on.
  3. Merge branches that share a file back to back. Resolve the conflict once, while both tasks are fresh.
  4. Run the tests after each merge, not after all five. A failing test after five merges does not tell you which one broke it.
  5. Remove the worktree once its branch is merged:
git worktree remove ../app-feature-auth
git worktree prune

The git docs: "When you are done with a linked worktree, remove it with git worktree remove," and git worktree prune cleans stale metadata. Leftover worktrees pile up quickly, and each one holds a branch name you may want again.

If you see the same file in two branches' diffs before you merge, treat that as a signal about your split in step 1, not as a one-off. Fix the split next time.

Step 6: budget the usage

Five sessions can burn through a plan fast. There is nothing to configure that changes that; you can only see it and choose.

Three facts from the docs shape the budget.

The limits are shared. Pro and Max have a five-hour limit and a weekly limit, shared with Claude chat (help center). The article lists no token counts for them. Our post on Claude Code usage limits walks through what is and is not published, and Pro vs Max 5x vs Max 20x covers the plans. As of the check date, Pro is $20 per month and Max 5x is $100 per month, per claude.com/pricing.

Each session sends its whole conversation each time. The Claude Code cost docs say Claude Code "sends your full conversation with every request," and that "your first message after a break longer than the cache lifetime misses the cache and reprocesses your full context" (costs docs). With five sessions, you will leave some idle while you read others, and the idle ones go cold.

Worktrees do not share a prompt cache. Per the prompt caching docs, sessions in the same directory build matching prefixes and can read each other's cache, while sessions in different directories miss each other's cache (prompt caching docs). That is a trade-off of worktrees: you buy file isolation and give up some cache sharing. For most people the isolation is worth it.

Practical steps:

  • Use the cheapest model that does the task. The costs docs say "Sonnet handles most coding tasks well and costs less than Opus" and suggest reserving Opus for "complex architectural decisions or multi-step reasoning." Our Opus vs Sonnet cost post puts numbers on it.
  • Run /clear between unrelated tasks inside a session, rather than carrying a long context into the next job.
  • Watch the cost line. /usage shows session cost, computed locally "from token counts at list price"; on Pro and Max the figure is not what you are billed (costs docs).
  • If you are on the API, not a plan, set a workspace spend limit in the Console before the first five-session day.

How often collisions happen

We counted this in our own transcripts, because the usual advice assumes collisions are constant and we wanted to see how often they are. Method, kept short: the data covers one small team running its own products between 2026-10-02 and 2026-11-23, 792 sessions and 13,412 file edits, from Claude Code transcripts. A "collision" is the same file edited by two different sessions within 10 minutes. The full method and caveats are in our collision data post.

The result: 39 files and 196 edit events met that definition, about 1.5% of the 13,412 edits. Separately, 593 of 4,498 edited files (13.2%) were edited by more than one session at some point in the seven weeks, just not necessarily at the same time.

Read that carefully. The data cannot tell us whether any of those edits overwrote another, and it does not count sessions that ran in separate worktrees or clones, because they edit different physical files. It is one team, mostly one model, over seven and a half weeks. It does not show that collisions are rare for you. It does show that for this team, simultaneous same-file edits were a small share of edits, while a file touched by several sessions over weeks was common. That matches the advice above: the risk is concentrated in a few shared files, so split the work around them.

Tools that manage the five sessions for you

You can do everything above with git and a few terminal tabs. If you would rather have a manager, these are the documented options, for the specific job of running several sessions.

Tool What it adds Platforms Price Source
Claude Code (built in) --worktree, .worktreeinclude, agent view Terminal tool; docs mention Windows and WSL Your Claude plan or API usage docs
Claude Squad tmux sessions plus a worktree per agent in a terminal UI; needs tmux and gh Homebrew or install script; Windows not listed Free, AGPL-3.0 README
CCManager Worktree manager with Idle, Busy and Waiting states; no tmux needed Node.js CLI; OS list not stated Free, MIT README
Conductor Mac app, one workspace and worktree per task, diff and PR flow macOS only; "not available for Windows or Linux yet" Free for now, per its FAQ docs
Emdash Desktop app, each agent in its own worktree and branch macOS, Windows, Linux Open source, Apache-2.0 GitHub
Nimbalyst Desktop app with kanban board, optional worktree per session macOS, Windows, Linux, plus iOS app $0 for individuals nimbalyst.com

Checked 2026-11-23; re-check before you choose. For a deeper look at three of them, see Claude Squad vs ccmanager vs Conductor and our Conductor review.

Where does Code Tycoon fit? It does a different job from the worktree managers. It runs your sessions on a dedicated server so they keep going when the laptop is closed, lets you answer them from a phone, and alerts you when two sessions edit the same file or module. It prices every session and flags cold resumes. It does not replace worktree isolation; you still want one checkout per session. If you run five sessions daily and want them off your laptop, see the server option.

Mistakes that cost people hours

Starting five sessions on the same branch. The one-branch-per-task rule prevents it. If you did it by accident, stop all five and check git status before doing anything else.

Two tasks with one lockfile. package-lock.json, Cargo.lock and poetry.lock conflict at merge in a way that is hard to read. Sequence tasks that change dependencies, or let one session own all dependency changes.

A session that "fixes" its environment. When a worktree lacks a .env, Claude may try to create one, install global packages or change a config file. Copy the files in with .worktreeinclude before the session starts.

Forgetting the shared port. Two dev servers on one port: the second fails or, worse, you test against the first session's server. Assign ports per worktree.

Leaving sessions idle for an hour. Going back to a session after a long break costs a full context re-read. Finish or close sessions you will not touch, or accept the cold start knowingly. The caching docs cover how the lifetime depends on plan and settings.

Running five when review is the bottleneck. If your review queue is always full, a sixth task does not help. Run fewer sessions or make the tasks smaller.

Using worktrees with submodules. Git's own docs warn against it. Use clones.

Pick this setup if

  • You work on one repo, or a few, from one machine and can split work into tasks that touch different files.
  • You are comfortable with git branches and merges.
  • You want no extra tool to learn, and a setup that matches the Claude Code documentation.
  • You are fine keeping your laptop on and awake while the sessions run.

Skip it, or add a tool, if

  • You want sessions to keep running with the lid closed: they need a server. See running Claude Code on a server and remote control alternatives.
  • You regularly have more than five sessions across many projects and cannot hold them in your head: a manager or a dashboard pays for itself.
  • Your tasks mostly share the same files: a different split will help more than any tool.

Frequently asked questions

How many Claude Code sessions can I run at once?

Nothing in the documentation sets a session count. The practical caps are your usage limits, which are shared across sessions, and how many sessions you can review. Many people start at three.

Do I need git worktrees to run parallel Claude Code sessions?

No, but you need some form of isolation. Separate clones work, and so do separate branches in separate checkouts. Worktrees are the lightest option because they share one object store, and Claude Code has a built-in flag for them, claude --worktree <name>.

Do parallel sessions use my usage limit faster?

Yes. Pro and Max have a five-hour limit and a weekly limit shared across Claude and Claude Code, and the agent view docs say each background session uses your subscription quota independently. The help center article gives no token counts, so check /usage as you go.

Why does a new worktree not have my .env file?

A worktree contains only tracked files. List gitignored files you need in a .worktreeinclude file in the repo root and Claude Code copies them into each new worktree it creates.

Can two sessions edit the same file safely?

Not in the same checkout. In separate worktrees they cannot overwrite each other on disk, but their branches will conflict at merge if both changed the same lines. In our own transcripts, 196 same-file edits within 10 minutes out of 13,412 edits, though that data cannot say whether any overwrote another.

Do worktrees share the prompt cache?

Per the Claude Code prompt caching docs, sessions in the same directory can read each other's cache and sessions in different directories miss it. A worktree is a different directory, so each starts with its own cache.

What is the easiest way to see which session needs me?

Claude Code's agent view (claude agents, research preview) shows Working, Needs input, Idle, Completed, Failed and Stopped states for background sessions. Claude Squad, CCManager and Code Tycoon also surface session status, in different ways.

Key takeaways

  • Give each session its own worktree and branch, named after the task: claude --worktree <name>.
  • Split the work by file before you start. Isolation moves conflicts to merge time; it does not remove them.
  • Copy .env and other untracked files with .worktreeinclude, and give each session its own port and database.
  • Merge the smallest independent branch first and run tests after each merge.
  • Five sessions share one usage limit; use cheaper models and /clear between tasks.
  • In our own data, same-file edits by two sessions within 10 minutes were 1.5% of edits, but 13.2% of edited files were touched by more than one session.

If you want the five sessions off your laptop, self-host Code Tycoon for free or compare the options in Claude Squad vs ccmanager vs Conductor.

Related articles


About this research

Anton Goldshtein is a two-time founder who previously bootstrapped a company to $100M in revenue. His team runs its own products on Code Tycoon every day.

This guide is based on the Claude Code and git documentation, the READMEs and docs of the tools named, read on 2026-11-23, and on summary statistics from our own Claude Code transcripts (2026-10-02 to 2026-11-23). Plans, limits and product features change, so verify on the linked pages.

Content reviewed and updated: 2026-11-26


Keep reading