cli: --worktree silently hangs when name contains a slash
Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Workaround ✓ Mentioned in description ↑
Activity 5 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.
Bug description
claude --worktree <name> silently hangs (no output, no error) when the worktree name contains a / character (e.g., improve/methodology). The process never renders the TUI and must be killed manually.
Reproduction steps
# This works fine:
claude --worktree test-no-slash
# This hangs indefinitely (no output at all):
claude --worktree improve/methodology
# Also hangs with --agent-name:
claude --agent-name cto --worktree improve/methodology
Expected behavior
Either:
- Create nested worktree directory (
.claude/worktrees/improve/methodology/) usingmkdir -pand proceed normally, or - Reject the name with a clear error message (e.g., "worktree name must not contain '/'")
Actual behavior
The process hangs silently — no TUI rendered, no error output, no exit. Must be killed with Ctrl+C or kill.
Investigation details
Tested systematically with script to capture TTY output:
| Command | Result |
|---------|--------|
| claude -w test-no-slash | ✅ Normal — TUI appears in ~2s |
| claude -w improve/methodology | ❌ Hangs — 45s+ no output |
| claude --agent-name cto -w test-no-slash | ✅ Normal |
| claude --agent-name cto -w improve/methodology | ❌ Hangs |
git worktree additself handles nested paths fine (manually tested withgit worktree add .claude/worktrees/improve/test -b worktree-improve/test— succeeds instantly)- After the hang, a residual empty
.claude/worktrees/improve/directory is left behind, suggesting the parent directory creation partially succeeds but the worktree setup fails silently
Workaround
Use - or _ instead of / in worktree names:
claude -w improve-methodology # works
Environment
- Claude Code: v2.1.81
- OS: Ubuntu (Linux 6.17.0-19-generic)
- Git: 2.47.2
- Shell: tcsh / bash
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same issue here!!!!
Has been fixed!!
https://code.claude.com/docs/en/changelog#2-1-83
This was fixed in v2.1.83 —
--worktreewith a name containing/now creates the worktree and exits with a clear error on failure 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.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.