[FEATURE] Drop worktree- prefix for branches created by "claude -w" or make it configurable
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Running claude -w <name> will create a git worktree at .claude/worktrees/<name> and a branch named worktree-<name>.
That prefix worktree- in a branch name is not the best fit since it's usually irrelevant for a branch name that it was created inside a worktree. Also it makes it much longer and might not be aligned with team's branch naming conventions.
IMO a user should be able to specify the name directly as they wish, without having to rename the branch every time they created a worktree.
The current only half stable workaround is to create both a WorktreeCreate and WorktreeRemove hook that replicate the worktree creation logic from claude -w but change the naming of the branch that gets created. Remove is needed because if there is a custom WorktreeCreate hook, claude will skip it's default remove logic as well. This ends up being quite a heavy solution for a simple naming prefix issue.
Proposed Solution
- Drop the hardcoded
worktree-branch name prefix. Direct control over the name seems sensible. Shouldn't impact folks since it only applies to new claude sessions. - Make that prefix (or naming pattern) configurable in claude's
settings.jsonfor anyone who prefers a separate naming scheme.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Example scenario:
- I want to work on feature
auth - I run
claude -w authto create a separate worktree - I would love to have the branch be named
authas well
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗