How to run several Claude Code sessions in parallel
Two agents in one folder overwrite each other's edits and break each other's builds. Give each one its own git worktree: a second checkout of the same repository, on its own branch, in its own folder.
Checked 29 November 2026
Why worktrees, not clones or branches
Switching branches in one folder stops the agent that is working there. A second clone works, but it is a second repository: fetches, remotes and stashes are not shared. A worktree shares the repository's history and objects and only adds a folder with its own branch checked out, so creating one takes seconds and uses little disk.
- Each agent edits only its own folder.
- Builds, test runs and dev servers do not collide on output folders.
- Each branch is reviewed and merged on its own.
By hand, with git
- Fetch, so the base is current
git fetch originin the main checkout. - Add a worktree on a new branch
Put worktrees in a sibling folder so tools that scan the repository do not find them.
- Start Claude Code in it
Open a terminal in the new folder and run
claude. Repeat for each task. - Clean up when merged
Remove the worktree with git, not by deleting the folder, so git forgets it.
git fetch origin
git worktree add -b fix/invoice-rounding ../shop-worktrees/fix-invoice-rounding origin/main
cd ../shop-worktrees/fix-invoice-rounding
claude
# later
git worktree list
git worktree remove ../shop-worktrees/fix-invoice-rounding
git worktree pruneWhat gets hard with four or more
- Knowing which terminal is waiting at a permission prompt, and for how long.
- Copying
.envand local config into every new worktree (see the guide on that). - Reviewing each branch's changes against the right base.
- Agents left running, or processes they leaked, after you moved on.
With Ourkite Bot
Ourkite Bot does the steps above for you and keeps the result in one window: ourkite new <branch> --base origin/main creates the worktree in <repo>-worktrees, copies the files listed in .ourkite/include, opens a terminal and shows the workspace as a tile in the dock with its state. Removing refuses a worktree with uncommitted changes or a running agent.
Try the preview
The preview is shared by email while the signed installer is prepared. Tell us how many agents you run and what you would want first.
- Windows 10 or 11, 64-bit
- Claude Code, signed in
- git
Windows 10 and 11 · Claude Code · early preview