Unclear When Claude Code picks a numbered name instead of the requested one is not stated.
What
A worktree is a second working copy of a git project in its own folder, so work can happen there without touching your main copy. Claude Code changes how it handles them:
- Creating a worktree can now pick a numbered name instead of using the requested name directly. If no usable name is found, it stops with an error saying the name "could not be used for a new worktree".
- Removing a worktree now looks at what the worktree is pointing at (its own branch, another branch, or no branch) to count its commits, instead of counting only from its latest commit. This deeper check is controlled by a server-side setting.
- A new option controls keeping worktrees inside a given folder.
Why
This reduces worktree name clashes and the chance of removing a worktree that holds commits you still need.
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
When Claude Code picks a numbered name instead of the requested one is not stated.