[BUG] Desktop app: selecting a "Branch to start from" that already has a worktree creates a new duplicate worktree instead of reusing the existing one

Status Open
Reported on v2.1.212
Maintainer reply None cached
Activity 1 comment · opened Jul 20, 2026

Environment

  • Platform: darwin (macOS 26.5, build 25F71, Darwin 25.5.0)
  • Claude Code desktop app — CLI reports 2.1.212
  • New-task composer with Local, project selected, "Branch to start from" set, and the worktree checkbox enabled

Summary

When I start a new task from the desktop composer and set "Branch to start from" to a branch that is already checked out in an existing worktree, with the worktree checkbox ticked, the app creates a brand-new (dummy) worktree rather than opening the session in the worktree that already exists for that branch.

Because a git branch can only be checked out in one worktree at a time, the existing worktree is the natural target — but the app ignores it and provisions another one, leaving me with a stray worktree and a session that isn't in the checkout I intended.

Steps to reproduce

  1. Have a branch already checked out in an existing worktree, e.g.:

``
/path/to/repo/.claude/worktrees/feature-xyz-a1b2c3 [user/TICKET-1234/feature-xyz]
``

  1. In the desktop new-task composer, choose Local → the project.
  2. Set "Branch to start from" to that same branch (user/TICKET-1234/feature-xyz).
  3. Leave the worktree checkbox checked.
  4. Start the task.

Expected

The session opens in the existing worktree for that branch (or the app detects the branch is already checked out in a worktree and reuses/offers it).

Actual

The app creates a new, separate worktree ("dummy" worktree) instead of using the existing one for that branch — so the branch's real worktree is bypassed and an extra worktree is left behind.

Impact

  • Duplicate/stray worktrees accumulate for branches that already have one.
  • The session doesn't land in the worktree I was actually working in.
  • Confusing when git normally refuses to check the same branch out in two worktrees (fatal: '<branch>' is already used by worktree at '...') — the app should treat the existing worktree as the target, not work around it.

Related

  • #31969 — Feature: Enter/resume existing worktrees (core gap: no way to switch a session into an already-existing worktree; EnterWorktree only ever creates new ones).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗