Allow disabling automatic worktree creation in Claude Code Desktop
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. There's no setting to disable this behavior and work directly on the main repository.
WorktreeCreate hooks with exit 1 in ~/.claude/settings.json don't prevent worktree creation either.
I'd like an option (e.g., a toggle in Settings → Claude Code) to disable automatic worktree creation so sessions operate directly on the repo, similar to how the CLI works by default.
Proposed Solution
A toggle in Settings → Claude Code (or a project-level .claude/settings.json option like "worktrees": false) to disable automatic worktree creation. When disabled, sessions would operate directly on the main repository checkout, matching the default CLI behavior (claude without --worktree).
Alternative Solutions
I've tried adding a WorktreeCreate hook with exit 1 in ~/.claude/settings.json to block worktree creation, but it doesn't prevent the Desktop app from creating them. Currently I work around this by using the CLI in the terminal, but I lose the Desktop app's UI benefits.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
- I'm working on a monorepo (NestJS backend + React frontend) using the Claude Code Desktop app
- Every new session creates a random worktree (e.g., .claude/worktrees/condescending-hodgkin), which disconnects me from my main branch and accumulates stale worktree directories
- With this feature, I could start a session directly on my main repo — same as running
claudein the terminal — but with the Desktop app's UI - This would save time because I wouldn't lose context between sessions, wouldn't need to merge/cherry-pick worktree changes back, and wouldn't accumulate stale worktrees I have to clean up manually
Additional Context
The WorktreeCreate hook in ~/.claude/settings.json doesn't prevent Desktop from creating worktrees. Setting "command": "exit 1" has no effect. The CLI respects --no-worktree by default, but there's no equivalent for Desktop.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗