claude-code - 💡(How to fix) Fix [FEATURE] Add option to disable git worktree creation by default for new sessions in Claude Code Desktop [1 comments, 2 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#56315Fetched 2026-05-06 06:31:24
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Claude Code Desktop (v1.5354.0, claude-code 2.1.121) creates a new git worktree under <project>/.claude/worktrees/<name>/ for every new session by default. There is no user-facing toggle to opt out — only a "Worktree location" dropdown that controls where worktrees are stored, not whether they're created.

Root Cause

Claude Code Desktop (v1.5354.0, claude-code 2.1.121) creates a new git worktree under <project>/.claude/worktrees/<name>/ for every new session by default. There is no user-facing toggle to opt out — only a "Worktree location" dropdown that controls where worktrees are stored, not whether they're created.

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

Summary

Claude Code Desktop (v1.5354.0, claude-code 2.1.121) creates a new git worktree under <project>/.claude/worktrees/<name>/ for every new session by default. There is no user-facing toggle to opt out — only a "Worktree location" dropdown that controls where worktrees are stored, not whether they're created.

What's missing

The internal useWorktree flag exists per session and defaults to true (useWorktree !== false). A non-worktree path also exists ("In-folder session" in the binary). But neither the CCD GUI nor ~/.claude/settings.json exposes a way to flip the default.

Requested

Either of:

  • A global toggle in CCD Settings: "Use git worktree for new sessions" (on/off)
  • A worktree.useByDefault: false field in settings.json
  • An "In-folder session" option in the new-session shortcut/dialog (Cmd+N)

Why

Some workflows (small repos, quick edits, hardware/CAD repos with binary artifacts) don't benefit from per-session isolation, and the worktree dir clutters the project. A memory note ("don't edit in worktree") helps inside the session but doesn't prevent CCD from creating it before launch.

Environment

  • macOS 15 (Darwin 25.3.0)
  • Claude Desktop 1.5354.0
  • claude-code 2.1.121

Proposed Solution

See above in the Claude written Problem Statement.

Alternative Solutions

See above in the Claude written Problem Statement.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

Add a global toggle in CCD Settings or a worktree.useByDefault: false field in settings.json to control the creation of git worktrees for new sessions.

Guidance

  • Investigate adding a "Use git worktree for new sessions" toggle in the CCD GUI settings to allow users to opt out of worktree creation.
  • Consider adding a worktree.useByDefault field to settings.json to provide an alternative configuration method.
  • Review the internal useWorktree flag and its default value to ensure it can be overridden by the proposed settings.
  • Evaluate the impact of not creating worktrees on session isolation and repository management.

Example

No code snippet is provided as the issue focuses on configuration and settings rather than code implementation.

Notes

The proposed solution requires changes to the CCD GUI and/or settings.json configuration. The feasibility of these changes depends on the existing architecture and implementation of Claude Code Desktop.

Recommendation

Apply a workaround by modifying the settings.json file, if possible, to include a worktree.useByDefault: false field, as this seems to be a more straightforward approach than modifying the CCD GUI.

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 [FEATURE] Add option to disable git worktree creation by default for new sessions in Claude Code Desktop [1 comments, 2 participants]