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-auth creates a worktree named feature-auth but the session remains unnamed
  • Users must manually run /rename to give the session a meaningful name
  • There's no CLI flag like --session-name to 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 /rename after entering a worktree — works but is repetitive
  • Shell aliases that combine --worktree with -p "/rename ..." — fragile workaround
  • A --session-name CLI flag — useful but doesn't cover the interactive EnterWorktree case

Ideally both the CLI --worktree path and the interactive EnterWorktree tool would auto-name the session.

View original on GitHub ↗

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