[BUG]

Resolved 💬 2 comments Opened Mar 23, 2026 by samfcmc Closed Apr 20, 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?

claude --worktree <name> hangs indefinitely when the corresponding branch already exists on the remote. The process never enters the worktree directory and produces no output.

What Should Happen?

claude --worktree <name> should detect that the branch already exists on the remote, check it out into the worktree directory, and start the session — exactly as it did in 2.1.80

Error Messages/Logs

No output is produced. Inspecting the hanging process with lsof shows the cwd is still the main repository root (the process never entered the worktree) and 3 established HTTPS connections to Anthropic's API that never resolve:

claude  14758  samuel  cwd   DIR  <project dir>
claude  14758  samuel   13u  IPv4  TCP host:51406->160.79.104.10:https (ESTABLISHED)
claude  14758  samuel   15u  IPv4  TCP host:51408->160.79.104.10:https (ESTABLISHED)
claude  14758  samuel   17u  IPv4  TCP host:51410->160.79.104.10:https (ESTABLISHED)

Steps to Reproduce

  1. Start a claude --worktree <name> session and push the branch to remote
  2. Close the session
  3. Run claude --worktree <name> again

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.80

Claude Code Version

2.1.81

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The 2.1.81 changelog mentions:
"Improved --worktree startup performance by reading git refs directly and skipping redundant git fetch when the remote branch is already available locally."

The new code path for handling existing remote branches appears to be making API calls that do not resolve.

Workaround: cd <worktree-path> && claude opens the session correctly.

Downgrading to 2.1.80 (by pointing the version symlink at the cached binary) confirmed the regression.

View original on GitHub ↗

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