Codeman logocodeman Download for MacMac app GitHub →

Run multiple Claude Code sessions at once and know which needs you

Updated 2026-10-16

On this pageTwo separate problemsIsolate the work with worktreesOption A: Claude Code's agent viewOption B: tmux windows and the terminal bellOption C: a hook that reaches you anywhereList and resume Claude Code sessionsHow Codeman handles it

Give each Claude Code session its own git worktree so their edits cannot collide, run each one in its own tmux window (or in Claude Code's agent view), and turn Claude Code's "needs you" signal into something visible from wherever you are: a tmux bell flag, a notification hook, or a dashboard that colours the session.

Two separate problems

Running five sessions at once goes wrong in two ways:

  1. Collisions. Several agents in one checkout overwrite each other's files, and one agent switching branches changes the tree under all the others.
  2. Attention. A session that stopped to ask a question looks exactly like one that is still working until you open it. With five of them you end up cycling through terminals, and a blocked session can sit for an hour.

Worktrees fix the first. The rest of this page is about the second.

Isolate the work with worktrees

A git worktree is a second checkout of the same repository on its own branch. Claude Code can create one for you:

claude --worktree feature-auth

Run the same command with a different name in another terminal for a second isolated session. Anthropic's docs note that the repository needs at least one commit first. With plain git:

git worktree add ../myapp-auth -b auth
cd ../myapp-auth && claude
# later
git worktree remove ../myapp-auth

Option A: Claude Code's agent view

claude agents opens agent view, one screen for Claude Code's background sessions: what is running, what needs your input, and what is done. Sessions waiting on you are grouped at the top with a yellow icon. A separate supervisor process runs the sessions, so they keep going after you close the view, and they are preserved while the machine sleeps (a shutdown still stops them). It is a research preview, and it covers Claude Code only. See agent view.

Option B: tmux windows and the terminal bell

If you want plain terminals, or you mix Claude Code with other CLIs, tmux can flag the window that needs you with no scripting.

Start one window per worktree:

tmux new-session -d -s agents -n auth    -c ~/src/myapp-auth    claude
tmux new-window     -t agents -n billing -c ~/src/myapp-billing claude
tmux attach -t agents

Then tell Claude Code to ring the terminal bell instead of sending a desktop notification. In ~/.claude/settings.json:

{
  "preferredNotifChannel": "terminal_bell"
}

Claude Code fires its notification when it finishes a task or pauses for a permission prompt and you appear to be away from the terminal. tmux monitors bells by default: a window that rings gets a ! flag in the status line and its name is drawn in inverted colours, so 1:billing! means that session wants you.

To check from a script or a status bar:

tmux list-windows -a -F '#{session_name}:#{window_name} #{?window_bell_flag,NEEDS YOU,}'

Two timing details from Anthropic's hooks reference: the permission notification fires once you have not typed for about six seconds, and the idle notification fires about 60 seconds after Claude finishes responding. A session can be done for a minute before it rings.

Option C: a hook that reaches you anywhere

The bell only helps while you are looking at tmux. A Notification hook in Claude Code's settings can run any command, such as a desktop notification or a push to your phone, and the hook input says which session and which kind of prompt it was. Get notified when Claude Code finishes or needs input has working examples.

List and resume Claude Code sessions

Claude Code saves every conversation per project directory, so a session you closed is not lost. From Anthropic's session docs:

Command What it does
claude --continue Reopens the most recent conversation in the current directory
claude --resume Opens the session picker; Ctrl+A widens it to every project on the machine, Ctrl+W to all worktrees of the repository
claude --resume <name> Resumes a named session directly
/resume Switches to another conversation from inside a session
claude -n auth-refactor or /rename auth-refactor Names a session so it is easy to find and resume when several run in parallel

Background sessions started from agent view also show up in the picker, marked bg, and claude agents lists the ones that are still running.

How Codeman handles it

Codeman runs every session as one CLI in its own tmux session and shows each as a tab in a browser dashboard, on a desktop or a phone. The attention problem is what most of its interface is about:

Several sessions can share one case (Codeman's name for a project directory), and the counter next to the Run button starts more than one at a time. Codeman can create the worktrees too: for a local case whose folder is a git repository, Git worktrees… in the case picker creates one at .claude/worktrees/<name>, the same place claude --worktree uses, and opens a session in it, and Close Session can remove it again (Git Worktrees). A worktree you made with git can be registered with Add Case → Link Existing, which leaves the folder where it is.

A Claude session can also start and supervise other sessions through Codeman's API, with lineage lines showing which session spawned which. See The Dashboard, Notifications And Approvals and Driving Codeman From An Agent.