Drowning in Claude Code sessions (and how I survive)
Each Claude Code chat lives in its own tmux window and comes back to its conversation after a restart. The status bar tells me which one is waiting for me, and a dedicated Claude sorts the windows and hands out the work.
I went from more than 50 Chrome tabs to more than 20 Claude Code sessions, one per tmux window. That gives me five problems:
- not losing any session
- knowing which one needs me
- finding a session
- not forgetting work
- handing work between sessions
Here a session is a Claude Code chat. When I mean a tmux session I say so.
The config and the cc-* scripts are in my
dotfiles. You need tmux 3.8. Key
bindings use the prefix, which I set to Ctrl+a, so prefix C means
Ctrl+a and then C.
Not losing any session
At first I restored my sessions with tmux-resurrect and claude --continue.
tmux-resurrect re-runs the command of each pane after a restart. But
claude --continue opens the latest chat of the directory, so five panes in
the same folder all came back to the same chat.
Each pane goes back to its chat: ccr
ccr (with alias cc=ccr) pins a session uuid in its own command line:
#!/bin/zshif [[ "$1" == -* ]]; then exec claude "$@"fi
id="$1"if [[ "$id" =~ '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' ]]; then shiftelse exec "$0" "$(uuidgen | tr '[:upper:]' '[:lower:]')" "$@"fi
session_files=(~/.claude/projects/*/"$id".jsonl(N))if (( ${#session_files} )); then claude --resume "$id" "$@"else claude --session-id "$id" "$@"fi- With no arguments it re-runs itself with a fresh uuid, so the uuid is in
the process
argv, which is what resurrect saves. - It runs
claudeas a child, not withexec. Theclaudeprocess shows up inpswithout arguments, so the uuid has to stay in the wrapper for resurrect to see it. - With an existing uuid it runs
--resume, socc <uuid>pins an old chat to a pane. - Flags (
cc -c,cc -r) go straight toclaude.
Autosave
set -g @resurrect-processes '~ipython ~ccr "claude->claude-restore"'set -g @resurrect-strategy-nvim 'session'set -g @continuum-restore 'on'set -g @continuum-save-interval '5'tmux-continuum saves every 5 minutes and restores when tmux starts. It runs
ccr and ipython again, and nvim with its session.
A pane saved as plain claude goes through claude-restore. This small
script takes the uuid from the saved --resume or --session-id and runs
ccr <uuid>. With
no uuid it leaves a shell with a note. The old fallback, claude --continue,
brought back the wrong chat.
prefix r is dangerous
prefix r reloads the config with source-file, which overwrites
status-right. tmux-continuum saves from a command in status-right, so
after a reload autosave died silently until the next restart. A restart once gave me back a layout
from two weeks earlier.
The fix is to write the hook in the config by hand, with the plugin’s
absolute path. #{@cc_count} is the counter from the next section.
set -g status-right "#{@cc_count}#[default]#($HOME/.tmux/plugins/tmux-continuum/scripts/continuum_save.sh) %Y-%m-%d %H:%M "After a reload, this command must print 1:
tmux show-option -gv status-right | grep -c continuum_saveKnowing which one needs me
With twenty sessions I had to go window by window to see which had finished and which was waiting on a permission prompt. Window names did not help, because almost every window was named after the same repo folder.
One status icon per window
Claude Code hooks in ~/.claude/settings.json call cc-tmux-state. It keeps
the state of each pane and draws an icon before the window name: yellow
working, green done, red asking for permission.
| Claude Code hook | Command |
|---|---|
UserPromptSubmit | cc-tmux-state working |
Notification (permission_prompt) | cc-tmux-state attention |
PostToolUse | cc-tmux-state resume |
Stop | cc-tmux-state done |
SessionEnd | cc-tmux-state clear |
setw -g window-status-format " #I #{@cc}#[default]#W "set-hook -g pane-focus-in 'run-shell -b "$HOME/.local/bin/cc-tmux-state seen #{pane_id}"'pane-focus-in marks the pane as seen, so green lasts until I look at the
window. Red lasts until I answer, because only PostToolUse clears it, once
the approved tool has run.

On the right, #{@cc_count} counts the red and green panes. prefix A opens
a popup with them, permission prompts first, then the finished turns I have
not seen, oldest first.

Windows with a useful name
The Stop hook calls cc-tmux-name, which renames the window after the
session title. It only touches single-pane windows with a generic name (the
directory, zsh) or a name it set before, never one I set by hand.
When the automatic title is long or vague, the /tmux-name skill makes the
session name itself, <ticket>-<slug> when there is a ticket or PR. It
renames the window and the chat so the hook does not overwrite it.
Telegram notifications
Ghostty desktop notifications do not get through tmux (I tried OSC 9 and
777, with and without allow-passthrough). When I want to know that
something finished, a bot sends me a Telegram message. It is one curl to
api.telegram.org/bot<token>/sendMessage, wrapped in a skill.
Finding a session
Finding the session for a given PR, among open windows and closed chats, took a while every time. And in a single tmux session, current work got mixed with finished work and work waiting on another team.
Session index: prefix g and prefix G
sessions.py is unpublished, because it is tied to my Jira and my repos. It
reads every transcript under ~/.claude/projects/ and keeps a local index with one
line per session: last activity, directory and title. Each line also lists the PRs and
tickets the session acted on (opened the PR, pushed, moved the ticket), with
their live status.
python3 ~/.claude/skills/sessions/sessions.py [all] [query] [--sync]With no arguments it opens fzf over every session. I filter with PROJ-1234,
open or draft, and Enter resumes the session in its directory with ccr.
From tmux I use two bindings.
prefix Gopens a popup with fzf over every tmux pane, with the window, name and title of each Claude session. Enter takes me to the pane.prefix gopens a floating pane that takes free text (“pr 2032”, “the timeout one”). A small model (haiku, throughclaude -p) picks the session and takes me to its pane, or resumes it in a new window if it is closed. It takes about 3 seconds.

It is also a Claude Code skill, so “go back to the session for PR 2032” works from a chat.
Three tmux sessions: doing, parked and oncall
Update, November 2026: I now run about eight tmux sessions, one per topic,
and dropped parked and the board window. The idea is the same.
doingholds what I am on now, whether a session is working, waiting for my answer or has an open PR or ticket. Its first window isboard, a dedicated Claude with no task that I use as a control center.parkedholds finished or paused work I want to keep open.oncallis for on-call duty. It stays apart so an alert does not mix with the day’s work.
Claude sorts the windows
Windows change state all the time. A PR gets merged, or a parked
session is needed again. From board I ask Claude to sort them with the tmux-board
skill.
Claude reads the summary of each session and the status of its PRs and
tickets. It proposes what goes to doing and what to parked, and better
names for windows with a generic one. It only moves them when I say yes.
It uses move-window, so the window keeps its process, its ccr with the
uuid and its icon. resurrect restores each tmux session by name.
Not forgetting work
I used to forget work, like a session left halfway or a deployed ticket that nobody validated.
/todo and the board window
/todo is a Claude Code skill, also unpublished. It pulls from the Atlassian
MCP, gh and the session index, and puts in one view:
- my assigned Jira tickets and the ones closed in the last week,
- my open PRs, the reviews requested from me and the ones merged in 7 days,
- the
doingwindows where a session is working, with its summary, - the stale tickets flagged by the session index.
A hook flags the stale tickets. When a session closes, SessionEnd calls
cc-session-end, which checks whether the session left a ticket out of date
(a merged PR with the ticket still open, for example). It writes the ticket
to ~/.claude/ticket-followups.tsv and shows it for 8 seconds in the status
bar. It never touches Jira.
/todo joins everything by ticket and splits it by whose move is next:
## Your move| Ticket | Next step | Window || PROJ-1234 timeout | validate in production | doing:4 || PROJ-1235 tokens | start (2 weeks in To Do) | |
## Waiting on others- PROJ-1236 → review by a teammate on repo#123 · doing:6
## Done (7 days)- Tickets: PROJ-1230, PROJ-1231Each row names the next step and the window, so I jump there with
prefix G. PROJ-1235 is the kind of ticket I used to lose, two weeks in To
Do and no session open.
I run /todo from board. A pending task that needs its own session gets
one with cc-spawn, or I go back to the existing one with prefix g.
Handing work between sessions
In the middle of a task I would spot a fix outside its scope, or want to split design from execution. Switching sessions made me lose the thread.
cc-spawn
cc-spawn [-p] [-w <branch>] <name> [dir]It opens a new window (or a pane with -p) that runs
ccr <uuid> --name <name> and prints the session uuid.
-w <branch>runs the session in<repo>/.worktree/<branch>(the/in the branch become-) and creates the worktree fromorigin/mainif it is missing. Several sessions can then work on the same repo without stepping on each other.- The pane only carries
ccrwith its uuid, never the task prompt, because resurrect would send the prompt again on every restart. I type the task afterwards, or the session that opened the pane sends it.
From tmux, prefix C asks for a name and runs cc-spawn in the current
directory.
cc-spawn works best from a Claude session. In login-timeout I see the
README is out of date and tell the session to fix it on the side. It runs
cc-spawn -w docs-readme docs-readme, hands over the task in a file with a
message between sessions (SendMessage) and keeps going. When the README is
done, it tells me in one line.

The two sessions can keep talking in both directions. I only look at the new window if its icon turns red.
Extras
Popups
A quick command used to mean opening a pane and closing it afterwards. Popups open on top of the layout and go away when done:
| Key | What it does |
|---|---|
s | pick a session with fzf and preview |
P | attach to another session |
Z | tmux-sessionizer (one session per project) |
O | browse sessions with tmux-oil.nvim |
D | edit the dotfiles, commit and push on close |
J | search Jira tickets |
N | create a ticket |
T is not a popup. It opens TODO.md in a 20% split on the left.
tmux-fzf-session and tmux-sessionizer are in the dotfiles. jira-fzf and
jira-new are unpublished scripts of mine on top of the Jira CLI.
Plugins
set -g @plugin 'tmux-plugins/tpm' # Plugin Managerset -g @plugin 'tmux-plugins/tmux-sensible' # A set of tmux options that should be acceptable to everyone.set -g @plugin 'tmux-plugins/tmux-resurrect' # Restore tmux environmentset -g @plugin 'tmux-plugins/tmux-continuum' # automatic restore and continuous saving of tmux envset -g @plugin 'tmux-plugins/tmux-open' # open on selection: o, c-o, s-sset -g @plugin 'wfxr/tmux-fzf-url' # fzf for urls in tmux: c-uWrapping up
I built all this without patching any tool, and to me that is good design. tmux lets any script read and change its state. Claude Code reports every event through a hook and can be launched and resumed from the terminal. fzf turns any list into a picker.
If you try only one thing, make it ccr, twenty lines that make your
sessions survive a restart. Second is the status icon, five hooks and one
tmux line.
Links
- tmux · man page · tpm
- tmux-resurrect · tmux-continuum · tmux-sensible · tmux-open · tmux-fzf-url
- Claude Code · hooks · skills · CLI
- fzf · tmux-sessionizer · tmux-oil.nvim
- gh · jira-cli
- Ghostty · Telegram Bot API
- My dotfiles