Auto-name sessions based on worktree name
Resolved 💬 3 comments Opened Mar 1, 2026 by barnon-apiiro Closed Mar 30, 2026
Feature Request
When creating a worktree with --worktree <name>, the session should automatically be named after the worktree (or the branch it creates).
Current Behavior
claude --worktree feature-authcreates a worktree namedfeature-authbut the session remains unnamed- Users must manually run
/renameto give the session a meaningful name - There's no CLI flag like
--session-nameto set it upfront
Proposed Behavior
When a worktree is created (either via --worktree CLI flag or EnterWorktree during a session), automatically set the session name to match the worktree name. For example:
claude --worktree feature-auth
# → Session is automatically named "feature-auth"
Motivation
When working with multiple parallel worktrees, sessions quickly become hard to distinguish in the session picker. Auto-naming them after the worktree/branch makes it easy to find and resume the right session.
Alternatives Considered
- Manually running
/renameafter entering a worktree — works but is repetitive - Shell aliases that combine
--worktreewith-p "/rename ..."— fragile workaround - A
--session-nameCLI flag — useful but doesn't cover the interactiveEnterWorktreecase
Ideally both the CLI --worktree path and the interactive EnterWorktree tool would auto-name the session.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗