Desktop app: add project-level setting to opt out of automatic git worktree creation
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
The Claude Code desktop app automatically creates a git worktree for every new session when the project is a git repository. There is no setting to disable this behavior.
This causes several problems:
- Unexpected file duplication — a full mirror of the entire project directory is created under
.claude/worktrees/<random-name>/on every session open. For a project like mine that lives in Dropbox, this means the full directory tree syncs to the cloud on every session, including all subfolders (memory files, chat logs, digests, etc.). - Orphaned directories and branches on crash — when a session crashes or is force-quit, both the worktree directory and the
claude/<name>branch are left behind. The user has to manually rungit worktree removeandgit branch -dto clean up. Normal session exits clean up correctly, but crashes are common enough (e.g. MCP connector schema errors that make every message fail) that this becomes a recurring maintenance task. - Inconsistent behavior — non-git projects run directly from the opened directory as expected. Git projects silently get a worktree. This inconsistency is confusing and non-obvious.
The CLI (claude from terminal) does not create worktrees automatically — it runs in-place. Only the desktop app does this. Switching to the CLI is not a viable workaround for users who depend on desktop app features.
Proposed Solution
Add a project-level setting in settings.json to disable automatic worktree creation:
{
"worktree": {
"autoCreate": false
}
}
When autoCreate is false, the desktop app would run the session directly from the opened directory, matching the CLI behavior. The existing sparsePaths option would still work when worktrees are manually invoked.
Alternatively, a global setting in ~/.claude/settings.json with a per-project override would also satisfy the use case.
Alternative Solutions
The only workaround is to use the CLI (claude from terminal) instead of the desktop app, which runs in-place without creating worktrees. This is not viable for users who rely on desktop app features.
Currently working around it with periodic manual cleanup: git worktree remove for orphaned directories and git branch -d claude/* for leftover branches after session crashes.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
I open Claude Code desktop app on a git repository (a personal knowledge management kit that lives in Dropbox). Every session creates a new worktree at .claude/worktrees/<random-name>/ containing a full mirror of my project. Since it's in Dropbox, the entire tree syncs to the cloud on every session open.
When a session crashes (e.g. due to an MCP connector schema error), the worktree directory and claude/<name> branch are orphaned. I have to manually clean them up with git worktree remove and git branch -d. This has happened repeatedly.
With worktree.autoCreate: false in my project's settings.json, the session would run directly from my project directory — matching how the CLI behaves and how non-git projects already work in the desktop app.
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗