Worktree badge persists in app UI for a non-worktree project across new sessions

Resolved 💬 2 comments Opened Jun 17, 2026 by sandrina-gruber Closed Jun 21, 2026

What happened

The app UI shows a "worktree" badge for a project that is not in a git worktree. The badge persists even when starting a brand-new session in that project.

Repro

  1. At some point, use a worktree for a project (e.g. via EnterWorktree).
  2. Return the project to its primary checkout (no linked worktrees remain).
  3. Start a brand-new session in that project directory.
  4. Observe: the worktree badge is still shown in the app UI.

Expected

No worktree badge, since git reports no worktree.

Git state (confirms it is NOT a worktree)

  • git rev-parse --git-common-dir.git
  • .git is a real directory, not a gitdir: pointer file
  • git worktree list shows only the single primary checkout on main

Environment

  • Claude Code: 2.1.177
  • Platform: macOS (Darwin 25.5.0)

Notes

The git side is clean; this appears to be stale app-side per-project session state retaining a prior worktree association. A full app restart is the current workaround.

View original on GitHub ↗

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