How to run several Claude Code sessions in parallel

To run several Claude Code sessions at once on the same repository, give each one its own Git worktree: a second folder for the same repository, on its own branch. Each agent then edits its own files, and nothing one does lands in another's work. The same goes for Codex and any other command-line agent, and it works the same way on Windows and Linux.

This page shows how to do that by hand, then how LlamaTree does it for you.

Why not just open more terminals in the same folder?

You can, and for agents that only read (answering questions, reviewing code) it's fine. Once two agents edit the same folder, though:

A worktree per task removes all three.

By hand: one worktree per task

From your repository's folder, make a worktree on a new branch for each task:

git worktree add ../shop-fix-login -b fix-login
git worktree add ../shop-new-report -b new-report

Each command makes a folder beside your repository, checked out on its own branch. They share one .git, so there's nothing to clone and branches are visible everywhere.

Then open a terminal in each folder and start an agent there:

cd ../shop-fix-login
claude

Use codex in place of claude for Codex. (Claude Code can also make the worktree itself: claude --worktree fix-login.) To pick a conversation up again later, run claude --resume (or codex resume) in the same folder and choose it from the list.

When a task is merged, remove its worktree:

git worktree list
git worktree remove ../shop-fix-login

A few things to know:

What gets hard as the number grows

Two sessions in two terminal tabs is manageable. With four or five, the work becomes keeping track:

With LlamaTree

LlamaTree is a free, open-source desktop app for Windows and Linux that runs these same agents, in real terminals, in one window. It does the steps above and shows you the things that are hard to keep track of.

Six sessions as live tiles, grouped by project in the sidebar, with Git Changes on the right
  1. Install it with the one line on the home page, and start a session: Ctrl+Shift+N, pick your repository's folder, and leave the command as claude or change it to codex.
  2. Add a worktree per task: the + at the end of the project's tabs › In a new worktree… creates the worktree on a new branch and starts a session in it.
  3. Watch the dots. Every session is a live tile with a status dot: blue while it works, pink when it needs your answer, orange when it finished while you weren't watching.
  4. Review each one's changes. Select a session and the Git panel shows that worktree's changes, with side-by-side diffs that refresh as the agent edits. Stage, commit and push from there.
  5. Work in several at once. Ctrl+click up to four sessions to put them side by side at full size. They stay together as a view you can come back to.

The Project view lines up every worktree of the repository in one table: its session and what it's doing, how many files it changed, how far it is ahead of and behind the base branch, and its pull request. It warns when two worktrees change the same file, and removes a worktree when you're done with it (never one with uncommitted changes).

Closing the window can leave the sessions running in the background, and each session reopens its own conversation after a restart, so there are no --resume ids to find.

Claude Code and Codex together

Nothing above is particular to one agent. In LlamaTree a session's command decides what it runs, so a Claude Code session and a Codex session can sit side by side in the same project, each in its own worktree or even in the same folder. AI agents lists the agents LlamaTree works with and what each one gets.

Updated 21 November 2026, for LlamaTree v1.4.0. Something wrong or missing? Tell us on GitHub.