Worktree directories should use meaningful names instead of random session names

Resolved 💬 3 comments Opened Apr 10, 2026 by kokosing Closed Apr 13, 2026

Preflight Checklist

  • [x] I have searched existing issues and this is not a duplicate
  • [x] This is a single, focused feature request

Problem Statement

When Claude Code creates a git worktree via the EnterWorktree tool, the worktree directory is named after the auto-generated session name (e.g., .claude/worktrees/hopeful-proskuriakova/). These names are completely random — there is no way to tell which task, branch, or session a given worktree belongs to without running git worktree list or inspecting the directory contents.

Proposed Solution

Use the git branch name (sanitized for filesystem use) as the worktree directory name instead of the session name. For example, a worktree for branch feature/my-task would be placed at .claude/worktrees/feature-my-task/.

If the branch name is not available at worktree creation time, fall back to a truncated task/prompt description, or keep the session name as a last resort.

Priority Level

Low - Nice to have

Feature Category

Configuration

Alternative Solutions

  • Users can manually rename worktree directories after creation (but requires updating the git worktree reference too)
  • git worktree list shows the branch for each worktree path, but requires the user to cross-reference

Use Case Example

A user runs multiple parallel worktrees for different features. After a week, .claude/worktrees/ contains hopeful-proskuriakova/, cranky-wescoff/, youthful-lehmann/ — none of which indicate what work was done there. With branch-named directories, they'd see feature-auth/, fix-dashboard-bug/, refactor-api/ instead.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗