Worktree flag hangs silently with branch names containing slashes

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 4 comments · opened Mar 24, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Description

Using the -w / --worktree flag with a branch name containing / causes Claude Code to hang silently — no output, no error. The process must be killed with Ctrl+C.

Replacing / with - in the same branch name works fine.

This was working correctly until recently (as of ~2026-03-23).

Steps to reproduce

# Hangs silently — no output, no error
claude -w "rodz/open-9825-prevent-inconsistencies-when-changing-themes-at-preferences"

# Works fine
claude -w "open-9825"

# Also works (slash replaced with dash)
claude -w "rodz-open-9825-prevent-inconsistencies-when-changing-themes-at-preferences"

Expected behavior

Claude Code should either:

  1. Create/enter the worktree normally (as it did before), or
  2. Show a clear error message if the branch name is invalid

Additional context

  • Other worktrees with / in the name already exist in the .worktrees directory and were created successfully in prior sessions
  • OS: macOS (Darwin 24.1.0)
  • This is a regression — / in worktree names worked until recently

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/38042
  2. https://github.com/anthropics/claude-code/issues/37965

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

benjaaguila · 6 months ago
ashwin-ant collaborator · 6 months ago

This was fixed in v2.1.83 — --worktree with a branch name containing / now works instead of hanging silently. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.