[BUG] `claude --tmux --worktree` creates worktree but Claude never starts — tmux session exits immediately

Resolved 💬 3 comments Opened Feb 22, 2026 by haacked Closed Feb 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When launching Claude Code with --tmux --worktree, the worktree is created but the tmux session immediately exits without ever starting an interactive Claude session. The tmux pane flashes briefly and shows [exited]. The parent process then hangs and requires Ctrl+C to return to the shell prompt.

Adding --verbose produces no additional output or log files.

Observations

  • The tmux session is not listed in tmux list-sessions after the failure
  • No log files are written to ~/.claude/logs/, /tmp/claude*/, or ~/Library/Logs/
  • Each attempt leaves an orphaned worktree and branch requiring manual cleanup
  • --tmux without --worktree errors with: Error: --tmux requires --worktree

What Should Happen?

Running claude --tmux --worktree should create a worktree, open a tmux session, and start an interactive Claude session inside it using the worktree as the working directory. On exit, the parent process should return to the shell prompt and offer to clean up the worktree.

Error Messages/Logs

Steps to Reproduce

  1. Navigate to a git repository
  2. Run:

``bash
claude --tmux --worktree
``

  1. Expected: A tmux session opens with Claude running interactively in the new worktree
  2. Actual: The worktree is created, the tmux pane flashes briefly, then shows [exited]. The parent process hangs until Ctrl+C is pressed.

Output:

<img width="751" height="95" alt="Image" src="https://github.com/user-attachments/assets/6be5ec39-977f-4cfd-9505-8d269305a67a" />

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.50 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Related

  • #27169 describes a related issue where the session works but hangs on /exit. This issue is different: Claude never starts interactively at all, and the tmux session exits immediately.

Environment

  • Claude Code: 2.1.50
  • macOS 15 (Darwin 25.2.0)
  • tmux 3.6a
  • git 2.52.0
  • Shell: zsh
  • Terminal: wezterm 20240203-110809-5046fc22

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗