Parallel Claude Code sessions: tell them apart

Updated

Quick answer

With several Claude Code sessions running, “Claude needs you” is not enough: you need to know which one. Put the project name in every alert, name your sessions and terminal tabs, and make sure an answer sent from your phone goes back to the session that asked.

Name sessions, tabs and worktrees

Start with names you can read at a glance. Claude Code gives every session a name you can set:

Claude Code also updates the terminal tab’s title from the conversation, so tabs stay recognizable without work on your side. If your terminal implements the OSC 7501 status protocol, each tab can show whether its session is working, waiting on you or done.

Parallel sessions on the same repository belong in separate git worktrees, so their edits don’t collide. claude --worktree feature-auth creates one under .claude/worktrees/feature-auth/ on a branch named worktree-feature-auth and starts Claude in it. A useful side effect: the folder name is now the task name, which is exactly what an alert should show. And for sessions you run in the background, claude agents opens agent view, one screen that groups them by what needs your input, what is working and what is done.

Put the project in every alert

Hooks receive a session_id and the session’s cwd on standard input. There is no session name field, so the folder name, and the git branch read from it, make the most readable label. This script works for a Stop hook and a Notification hook on macOS:

Save as ~/.claude/hooks/which.sh, then chmod +x it

#!/bin/sh
# Claude Code hook: an alert that says which session it comes from. Reads the hook JSON on stdin.
input=$(cat)
cwd=$(printf '%s' "$input" | jq -r '.cwd')
branch=$(git -C "$cwd" branch --show-current 2>/dev/null)
title="Claude Code · $(basename "$cwd")${branch:+ · $branch}"
if [ "$(printf '%s' "$input" | jq -r '.hook_event_name')" = "Stop" ]; then
  body="Finished"
else
  body=$(printf '%s' "$input" | jq -r '.message // "Needs you"')
fi
osascript -e 'on run argv' -e 'display notification (item 2 of argv) with title (item 1 of argv)' \
  -e 'end run' "$title" "$body"
exit 0

Passing the text as arguments to osascript, rather than pasting it into the AppleScript, keeps quotes in Claude’s message from breaking the command. On Linux, replace the last command with notify-send "$title" "$body". The same label belongs in any push you send to your phone: an alert that says pebble · fix-login is one you can act on without opening a laptop.

One live card per session

Separate notifications for each step of each session pile up fast. On an iPhone, a Live Activity solves that: one card per session on the lock screen, updated in place, that shows what that session is doing and for how long. Monish keeps one live card per running Claude Code session, named after its project. When that session needs you, its card turns yellow and shows the request itself, with Allow and Deny, and a notification with sound goes out.

Answers go back to the session that asked

Telling sessions apart matters most when you answer. With hooks, the routing comes from how they work: each request is held by a hook process that the session that asked started, and that process waits for the answer. When the answer comes back, it goes to that process and so to that session, never to the one next to it.

If you build your own approval loop, around a chat bot for example, keep that property. Give every request an identifier, put it in the message, and accept only a reply that carries it. Claude Code’s own channel plugin for Telegram does this: a typed answer to a permission prompt must carry the five-letter code sent with the prompt.

The same holds for a reply to a finished turn. In Monish, replying to “Done · pebble” sends your text to the pebble session only, where it becomes Claude’s next instruction. Meanwhile that session’s terminal stays free: if you type a new instruction there first, the turn is closed and the reply from the phone is not sent.

Several computers, one iPhone

Sessions on a laptop, a desktop and a build server can all reach one iPhone. With Monish, pair each computer with its own 6-digit code, using curl -fsSL https://monish.cc/install.sh | sh -s on each. Every notification names the project, and the computer too once more than one is paired, such as Claude Code · harbor · MacBook Pro. Each computer has its own page in the app, with its name and the commands you always allow there. The answer window, quiet hours and Live Activities are set once, in the app’s Settings, for every computer.

Questions

How do I name a Claude Code session?
Pass -n at startup, as in claude -n auth-refactor, or run /rename during the session. The name shows on the prompt bar and works with claude --resume.
Does a hook know which session it runs in?
It receives the session’s session_id and cwd. There is no name field, so the folder name and the git branch are the most readable labels to put in an alert.
Will an answer from my iPhone reach the wrong session?
No. A request is held by the hook process of the session that asked, and your answer goes back to that process. The prompt also stays in that session’s terminal until one of the two answers it.
Can two sessions share one live card?
Not in Monish: each running session gets its own card, named after its project, so you can see at a glance which one is working and which one needs you.

More guides

New to Monish? The home page shows what lands on your iPhone, and all guides are listed here.

Get Monish on your iPhone

Free, no account. Your 6-digit code is waiting in the app.

Download on the App Store