DEV Community

Eren Çolak
Eren Çolak

Posted on Edited on Originally published at paneherd.com AI-assisted

How to run multiple Claude Code sessions at once

I make Paneherd, which is option 4 below. Originally published at paneherd.com.

Claude Code works best on one focused task at a time, so the way to get more done is to run several sessions in parallel: one fixes a bug, one writes tests, one updates the docs. Doing that well comes down to three things: keeping each session's changes separate, noticing when one of them is waiting for you, and not running out of usage halfway through.

Here are four ways to do it, and what each one leaves to you.

1. Separate terminals

The simplest way: open a terminal per task and run claude in each, or use split panes in tmux, Windows Terminal or your editor. It costs nothing and works everywhere.

What it leaves to you: every session asks for permission in its own terminal, so you have to look at each one to see which is stuck. If two sessions work in the same folder, they share the files, the branch and the uncommitted changes, so one session's half-finished edit can break the other's tests and their diffs get mixed.

2. Git worktrees

A git worktree is a second checkout of the same repository in another folder, on its own branch. Give each session that changes code its own worktree and each one edits its own copy of the files; you merge their branches when they are done. Claude Code can create one for you with claude --worktree.

What it leaves to you: each worktree needs its own dependencies installed and its own dev server port, and you still watch each session separately.

3. Claude Code's agent view

Claude Code has its own view of running sessions (claude agents), and the official VS Code extension shows the status of each session. Agent view lists background sessions by state (working, needs input, completed) and, inside a git repository, moves each session into its own worktree before it edits. The extension runs several conversations in tabs and queues a message you send while Claude works. Permission prompts are still answered in each session. Check the Claude Code documentation for what your version includes.

4. A grid in VS Code or Cursor

Paneherd is an extension that opens each session as a real terminal in the editor area and lays them out in a grid. The sidebar shows each session's status from Claude Code's own hook events, counts the ones waiting for you, and jumps to the next one. On top of that:

  • One permission inbox (Pro): prompts from every session collect in the sidebar, with the command or file, and you answer them there.
  • Broadcast and queue: send one prompt to several sessions, or queue the next prompt for a busy one (queue is Pro).
  • Usage limits: the five-hour and weekly limits of your plan, at the top of the sidebar.

It can create the worktree for a pane (tick Own git worktree next to New session) or work alongside worktrees you made yourself, and shows every session in one window. The free version runs as many sessions at once as you like.

Four Claude Code sessions in a grid in VS Code, with the Paneherd sidebar showing three permission requests and a queued prompt.

Tips that apply whichever way you choose

  • One task per session, stated in the first prompt. Sessions that wander are the ones that collide.
  • Don't let two sessions edit the same files. Split work by area, or use worktrees.
  • Keep permission prompts on for anything that touches the outside world. Answer them quickly so sessions don't sit idle.
  • Watch your limits. Parallel sessions use your plan's limits several times faster.

More on this: handling permission prompts across sessions and how parallel sessions use your usage limits.

How do you run your sessions? I'd like to hear what works for you in the comments.

Top comments (2)

Collapse
 
fallemand profile image
Facundo Allemand •

To your closing question: my problem shows up after the sessions run, when I have five across three repos and can't remember which window or worktree each one lives in. The official extension only shows the open folder's sessions, so I built a free extension that lists all of them grouped by repo, with worktrees nested, and one click opens the right worktree window and resumes there: github.com/fallemand/claude-multir...

Some comments may only be visible to logged-in visitors. Sign in to view all comments.