Add option to disable automatic git worktree creation in Claude Desktop

Resolved 💬 2 comments Opened Mar 26, 2026 by GuideThomas Closed Mar 26, 2026

Preflight Checklist

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

Problem Statement

Feature Request: Add option to disable automatic git worktree creation in Claude Desktop

Problem

Claude Code Desktop automatically creates a new git worktree and branch (e.g. claude/serene-jackson) for every new session. There is no way to disable this behavior — the Settings UI only allows choosing the worktree storage location ("Inside project" or "Custom"), but not turning the feature off entirely.

For users who prefer working directly on main (or any current branch) without branch isolation, this creates significant friction:

  • Stale worktree directories accumulate in .claude/worktrees/
  • Orphaned claude/* branches pile up locally and on remotes
  • Changes made in a worktree session don't appear on main without manual merging
  • Users who don't use a PR-based workflow have to clean up after every session

Current behavior

  1. Open Claude Code Desktop on a git repository
  2. App automatically runs git worktree add and git checkout -b claude/<random-name>
  3. All work happens in the isolated worktree, not on the original branch
  4. No setting exists to prevent this

Environment

  • Claude Code Desktop (Windows 11)
  • Git repository with simple single-branch workflow
  • No PR/review process needed for this repo

Additional context

The CLI (claude) works perfectly without worktrees by default. This issue is specific to the Desktop app which forces worktree creation with no opt-out.

Proposed Solution

Expected behavior

A toggle in Settings (e.g. "Use git worktrees" — on/off) that allows users to disable automatic worktree creation. When disabled, Claude Code Desktop should work directly on the current branch, just like the CLI does by default (claude without --worktree flag).

Alternative Solutions

Workaround

Currently the only workaround is manually cleaning up after each session:

# Remove worktree directories
rm -rf .claude/worktrees/

# Delete orphaned branches
git branch -D claude/random-name

# Clear worktree registry
# Edit %APPDATA%/Claude/git-worktrees.json → set "worktrees": {}

Priority

Medium - Would be very helpful

Feature Category

File operations

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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