Keep track of many Claude Code sessions
Run Claude Code in four terminal tabs and the only way to find the one that's stuck waiting on you is to click through them. How to do it yourself (tab titles, notifications, tmux, claude agents), where that falls short, and how to see it all in one menu bar window.
Why sessions get missed
Each session lives in its own tab or window, so when one stops on a permission prompt or a question you don't find out unless you're looking at that tab. Meanwhile the others finish, and the stuck one sits there for half an hour. People keep asking for this: a request to see every session at once with whoever is waiting next brought to the front (anthropics/claude-code#103971), a report that grouping by project disappeared from the desktop app's session list (#102088, 60+ comments), and one that the Codex app's list sometimes leaves out the “Awaiting approval” label (openai/codex#56811).
Doing it yourself
Tell tabs apart by title: Claude Code sets the terminal tab title from the conversation. Name a session with /rename auth refactor and the tab shows that name, so at least you know which tab is which.
Get alerted when it waits: Ghostty and Kitty show a macOS notification when Claude Code is waiting, with no setup; in iTerm2, turn on ‘Notification Center Alerts’ and ‘Filter Alerts › Send escape sequence-generated alerts’ under Settings › Profiles › Terminal. For other terminals, such as the built-in Terminal, add "preferredNotifChannel": "terminal_bell" to ~/.claude/settings.json to ring the bell. Inside tmux, add set -g allow-passthrough on to ~/.tmux.conf or the alerts never reach the outer terminal.
Put the project name in the alert: with several alerts you can't tell which session sent which. The Notification hook receives cwd (the project folder) and message, so put the folder name in the title. Save this as ~/.claude/notify-project.sh, chmod +x it, and set it as the Notification hook command as in the notifications guide.
#!/bin/sh
in=$(cat)
proj=$(printf '%s' "$in" | jq -r '.cwd | split("/") | last')
msg=$(printf '%s' "$in" | jq -r '.message' | tr -d '"\\')
osascript -e "display notification \"$msg\" with title \"Claude Code · $proj\""List the sessions running now: claude agents opens a view of background sessions with their state (working, needs input, done). With --json it prints the sessions open on this Mac and exits; when we tried it, sessions opened directly in terminals were in the list too. For a short per-project view:
claude agents --json | jq -r '.[] | "\(.status)\t\(.cwd | split("/") | last)\t\(.name // "")"'Terminals that implement OSC 7501 (the Program Status Protocol) can mark each tab as working, waiting or done. Sessions started inside tmux don't report that status to the outer terminal, though. For Codex CLI, notifications = ["agent-turn-complete", "approval-requested"] under [tui] in ~/.codex/config.toml gives terminal alerts when a turn ends or an approval is requested.
Limits: an alert you miss is gone, and the list only appears when you type the command. Claude Code and Codex each need checking separately, and to see what needs approving you still have to find that tab. The --json fields are documented but can change between versions.
With Lidnight: one menu bar window
Lidnight gets each session's state through Claude Code and Codex hooks and shows one row per session in its menu bar window: project name, status and elapsed time, with sessions waiting for approval at the top. A session whose last message is a question is marked “Needs reply”, and just-finished ones stay for 30 minutes with their result line. Click a row and the terminal or editor app that started that session comes to the front (it doesn't pick the tab for you; a session from the Claude desktop app opens that conversation).
The session list and allowing or denying from the menu bar or a Mac notification are free. Approvals by the notch, getting and answering them on your phone, and keeping going with the lid closed are Pro, all included in the free trial (5 runs or 14 days). Alert only when a session is waiting on you
Try Lidnight free
Apple Silicon Macs · macOS 13 or later. Every download includes a free trial of everything in Pro (5 lid-closed runs or 14 days), no payment details needed. Pro is a one-time payment (1 Mac $9.99 · 3 Macs $14.99) with a 14-day refund.