claude-code - 💡(How to fix) Fix claude -w <name> --tmux parent process does not exit after the spawned tmux Claude session ends

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Workaround

Press Ctrl-C in the launching terminal after exiting the inner session to unblock the parent command.

RAW_BUFFERClick to expand / collapse

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 original claude 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.

  1. Create and enter a fresh git repo:

    mkdir repro && cd repro && git init && git commit --allow-empty -m init
  2. Run:

    claude -w repro --tmux
  3. Wait for the new tmux session/Claude session to start.

  4. Exit the inner Claude session (e.g. /exit or Ctrl-C twice).

  5. Observe: the original terminal's claude command 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix claude -w <name> --tmux parent process does not exit after the spawned tmux Claude session ends