claude-code - 💡(How to fix) Fix [FEATURE] BULLSHIT feature of worktree - who genius developed it? [1 participants]

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…
GitHub stats
anthropics/claude-code#45513Fetched 2026-04-09 08:03:40
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

  1. Diverged git histories Each session creates a branch like claude/random-name. After 12+ sessions, you end up with 12+ diverged branches that are nearly impossible to merge back cleanly — --allow-unrelated-histories, rebase conflicts, force pushes become the only way out.

  2. Lost work Files created in a worktree are invisible from the main project directory. If the worktree gets cleaned up, those files are gone. I lost important project documents this way — they were committed to a worktree branch but never visible in my actual project folder.

  3. Context loss across sessions Key decisions and artifacts from one session live in a worktree branch. Starting a new session creates a fresh worktree that doesn't have those changes. You have to manually merge between sessions just to maintain continuity.

  4. No user control There is no setting, flag, or config to disable this behavior in the Desktop app. The CLI works fine without worktrees (claude without -w), but Desktop forces it.

Proposed Solution

Add a setting in Claude Code Desktop to disable automatic worktree creation, so sessions work directly in the main project directory — the same behavior as the CLI without -w.

This should be a simple toggle: Settings → "Use git worktrees for session isolation" → OFF.

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

Over multiple sessions, I worked with Claude to develop foundational design principles for my project — core rules that govern how the entire system reasons and operates. The session where we developed these committed the file to a worktree branch (claude/magical-moser). Session ended, I moved on.

Weeks later, the file was gone. Not in my project directory, not on main, not anywhere visible. The worktree had been cleaned up. After extensive searching through 12 session transcripts, I found the original discussion buried in a JSONL log and had to reconstruct the file manually.

If that transcript had been compacted or lost, foundational project IP would have been permanently destroyed.

Additional Context

No response

extent analysis

TL;DR

Adding a setting to disable automatic worktree creation in Claude Code Desktop could resolve issues with diverged git histories, lost work, and context loss across sessions.

Guidance

  • Consider adding a toggle in the Settings menu to disable worktree creation, allowing sessions to work directly in the main project directory.
  • Verify that the proposed solution addresses the issues with diverged git histories, lost work, and context loss by testing the new setting with multiple sessions.
  • To mitigate the issue in the meantime, users could manually manage their worktrees and ensure that important files are committed to the main branch.
  • The CLI behavior without the -w flag could serve as a reference for implementing the proposed solution in the Desktop app.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The proposed solution assumes that adding a setting to disable worktree creation is feasible and aligns with the existing architecture of Claude Code Desktop.

Recommendation

Apply workaround: Implement the proposed setting to disable automatic worktree creation, as it directly addresses the reported issues and aligns with the existing CLI behavior.

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