Skip to content

Desktop UI shows 'main' branch instead of worktree branch after EnterWorktree #46574

Description

@burntcones

Bug

After entering a git worktree via EnterWorktree, the Desktop app UI continues to display the main repo's branch (e.g., main) instead of the worktree's branch (e.g., claude/loving-torvalds).

Steps to Reproduce

  1. Open Claude Code Desktop app in a git repo on main
  2. Use EnterWorktree to enter/create a worktree (e.g., loving-torvalds)
  3. Observe the branch indicator in the Desktop UI

Expected

UI shows the worktree branch: claude/loving-torvalds

Actual

UI still shows main (the branch of the original repo root).

Verification

CLI commands confirm the session is correctly operating in the worktree:

CWD: /Users/.../bc-retail-hub/.claude/worktrees/loving-torvalds
Branch: claude/loving-torvalds
Git dir: /Users/.../bc-retail-hub/.git/worktrees/loving-torvalds
Toplevel: /Users/.../bc-retail-hub/.claude/worktrees/loving-torvalds

All file operations and commits happen on the correct worktree branch — this is purely a UI display issue.

Environment

  • Claude Code Desktop app (macOS)
  • Darwin 25.3.0
  • Git worktree created via .claude/worktrees/

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions