Guide
How to run multiple Claude Code sessions at once
Opening a second terminal and typing claude again is easy. Keeping the two sessions from editing the same files underneath each other is the actual problem, and it has a clean answer.
Why two sessions in one folder go wrong
Each Claude Code session reads files, makes a plan and writes edits. It does not know another session is changing the same working copy. When both touch one file, the later write wins, and neither session notices — the failure is silent until the tests or the diff look strange.
Sharing one checkout also shares one branch, one index and one set of build artefacts. A session running the test suite while another is halfway through a refactor reads a tree that is neither version.
The fix: one git worktree per session
A git worktree is a second working directory attached to the same repository: its own branch and files, the same history and objects, no second clone. Give each session one and they cannot collide.
- git worktree add ../myapp-auth -b agent/auth — a new folder and branch for the first task.
- git worktree add ../myapp-tests -b agent/tests — a second one for the next task.
- cd ../myapp-auth && claude — start a session in each folder, in its own terminal.
- git diff main...agent/auth — read each result before merging it.
- git worktree remove ../myapp-auth — clean up once the branch is merged or discarded.
The mistakes that cost time
- Forgetting untracked files. A new worktree has what is committed, not your .env or local config. Copy them in, or the session spends its first ten minutes debugging a missing variable.
- Forgetting dependencies. node_modules, virtualenvs and build outputs are per folder. Install in each worktree, or point the package manager at a shared store.
- Two sessions on overlapping files. Worktrees prevent overwrites, not merge conflicts. Split tasks by area of the codebase, not by size.
- Too many at once. Three sessions is usually where review becomes the bottleneck. More agents than you can read diffs for is not faster.
Doing it without the bookkeeping
By hand this is five commands per task plus remembering which terminal is which. Nix Agents does the same thing as a board on Windows: each Claude Code session starts in its own worktree and terminal, and the diff is shown before you merge. It runs the Claude Code you already have installed, with your own login.
Questions
- Can two Claude Code sessions run in the same folder?
- They can start, but they will edit the same working copy without knowing about each other. Use one git worktree per session instead.
- Does each worktree use another Claude subscription?
- No. Worktrees are a git feature; every session uses the same Claude Code login. Running more sessions uses more of your plan’s usage, the same as running them one after another would.
- How many sessions should I run in parallel?
- Start with two or three. The limit is usually how many diffs you can review carefully, not how many terminals you can open.
