Support renaming the active worktree from within a Claude Code session
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
Claude Code creates a git worktree per session, which is great for parallel work. The worktree folder is named after the auto-generated branch (e.g. .claude/worktrees/beautiful-austin-3599ac/), and once a session is underway the user often wants a more meaningful name.
Renaming the branch alone (git branch -m) already works fine from inside a live session, but the folder name then drifts out of sync with the branch name. Renaming the folder itself currently requires ending the session, because git worktree move <old> <new> cannot operate on the directory a running session has as its working directory.
The result is either a stale folder name or an interrupted session — neither feels good when worktrees are otherwise designed for long-lived parallel work.
Proposed Solution
Two related improvements:
- A UI affordance to rename the current worktree. The Claude Code host could stop the session, run
git worktree move <old> <new>, and restart the session pointed at the new path — making the rename feel atomic from the user's perspective. - Allow Claude to rename its own worktree on request. Something like "rename this worktree to X" would trigger the same host-mediated stop / move / restart flow, so the rename can be driven conversationally rather than by leaving the session.
Both routes converge on the same host-mediated operation; only the trigger differs.
Alternative Solutions
- Manual workaround: end the session,
git worktree move, restart. Works, but breaks flow and loses in-session state that isn't persisted. - Rename branch only (
git branch -m, already possible mid-session): keeps the session alive but leaves folder and branch names out of sync. - #54653 requests branch renaming mid-session and explicitly scopes itself to not touching the folder path. This request is the folder-side counterpart.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- Start a session — worktree is
.claude/worktrees/beautiful-austin-3599ac/on branchclaude/beautiful-austin-3599ac. - After describing the task, ask Claude (or click a UI button) to rename the worktree to
worktree-rename-feature. - Host stops the session, runs
git worktree move .claude/worktrees/beautiful-austin-3599ac .claude/worktrees/worktree-rename-feature, then restarts the session in the new path. - From the user's perspective, the rename is atomic — same conversation, new folder name.
Additional Context
Related: #54653 (branch rename mid-session) — this request is the folder-side counterpart. Together they would let users keep branch name, folder name, and task intent aligned without ending the session.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗