claude -w <name> --tmux parent process does not exit after the spawned tmux Claude session ends
What happened
Launching Claude in a worktree with a tmux session via:
claude -w refactor --tmux
correctly blocks the launching shell while the new Claude session runs in the
new tmux session. However, after I exit the inner Claude session, the originalclaude command in the launching terminal does not exit. It hangs until I
manually interrupt it with Ctrl-C.
Expected behavior
When the spawned tmux Claude session exits, the parent claude -w … --tmux
command should detect the child's termination and exit cleanly on its own,
returning control to the launching shell — without requiring a manual Ctrl-C.
Actual behavior
The parent command remains blocked after the child session ends. Pressing
Ctrl-C in the launching terminal unblocks it and returns to the shell prompt,
but it never exits on its own.
Reproduction
Reproduced in a brand new, empty git repo. The flags -w + --tmux alone are
sufficient — no --permission-mode needed.
- Create and enter a fresh git repo:
mkdir repro && cd repro && git init && git commit --allow-empty -m init
- Run:
claude -w repro --tmux
- Wait for the new tmux session/Claude session to start.
- Exit the inner Claude session (e.g.
/exitor Ctrl-C twice). - Observe: the original terminal's
claudecommand is still blocked and does
not return to the shell prompt until you press Ctrl-C.
Environment
- Claude Code: 2.1.156
- tmux: 3.6b
- OS: Linux WSL2 (
6.6.87.2-microsoft-standard-WSL2, x86_64) - Shell: zsh (
/home/linuxbrew/.linuxbrew/bin/zsh) - TERM:
tmux-256color
Notes
- Possibly related to process-lifecycle/SIGCHLD handling issues such as #52544
(parent not reacting to child exit) and #62659 (orphaned child processes),
though neither is tmux+worktree specific.
- The CLI reference does not document the expected exit/cleanup behavior for
--tmux sessions, so this may be an unspecified edge case.
Workaround
Press Ctrl-C in the launching terminal after exiting the inner session to
unblock the parent command.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗