claude-code - 💡(How to fix) Fix Worktree isolation default-on causes confusing stale-deploy bug

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

The "isolate session in a git worktree" checkbox on the new-session screen defaults to ON in the desktop app. This default is a footgun for any workflow where the user builds/deploys from the main checkout:

  1. Claude edits and commits in .claude/worktrees/<name>/
  2. Pushes land on origin/main
  3. The user's main repo working tree stays at the old commit
  4. Builds run from the main repo → produce stale artifacts
  5. User uploads stale artifacts → "why is my change not deployed?"

I just spent ~30 minutes debugging exactly this. Symptoms looked like a cache problem (already added a query-string buster), then a build script problem (chased an EXPO_PUBLIC_BUILD_TIME red herring), before Claude finally noticed the deployed bundle hash matched the main repo's stale dist/, not the worktree's fresh one.

Two suggestions:

  • Default the checkbox OFF. Opt-in for isolation. The cost of forgetting to opt-in is "I edited in place, fine" — much lower than the cost of forgetting to opt-out.
  • Or: when a session is spawned in a worktree, surface a clear banner ("Edits are isolated in .claude/worktrees/foo — your main checkout will need git pull after pushes") so the divergence isn't invisible.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Worktree isolation default-on causes confusing stale-deploy bug