Use worktree directory name as default session/terminal title

Resolved 💬 3 comments Opened Mar 7, 2026 by hakanensari Closed Mar 7, 2026

When Claude Code is launched with --worktree, the terminal tab title should be distinguishable from other sessions. Currently all worktree sessions look the same because titles are purely inferred from conversation content.

Problem

Working with multiple worktrees in parallel (each in its own terminal tab), there's no way to visually distinguish sessions. Tab real estate is limited, so solutions need to be compact.

Proposal

Allow a configurable title prefix for worktree sessions. Something like:

// .claude/settings.json or similar
{
  "worktree": {
    "titlePrefix": "short"  // use first path segment, e.g. "577"
  }
}

Result: 577 · discussing order sync

The prefix source would vary by team convention — some use issue numbers (577-order-sync), others use feature names (redesign-nav), etc. Making it configurable keeps it general.

Alternatively, a simpler approach: just always prefix with the worktree directory name (or a truncated version), and let /name override when needed.

Current behavior

  • claude --worktree 577-order-change-sync opens a session
  • Terminal title is inferred from conversation content only
  • No way to distinguish multiple worktree tabs at a glance
  • Shell-level title hacks get overridden by Claude Code

View original on GitHub ↗

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