[BUG] Claude Code Desktop silently creates a git worktree without user consent or notification. Could lead to data loss.

Resolved 💬 3 comments Opened Nov 27, 2025 by DavidTsGit Closed Nov 27, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Wasn't sure if this should be a bug (potential data loss) or feature request (it's likely currently working as designed). So I asked Claude. His response:

I'd argue it's both, but leans toward bug for these reasons: Bug argument: - Silent data divergence is a defect, not a feature. If a user reasonably expects their files to be edited and they're not, that's broken behavior regardless of intent. - Missing uncommitted changes without warning could lead to real data loss or wasted work - you could spend an hour having Claude build on an outdated state. - The principle of least surprise is violated. Feature request argument: - It's technically "working as designed" (worktrees are intentional) - The fix is adding UI/warnings, not changing core behavior My suggestion: File it as a bug with the framing: "Claude Desktop silently creates a git worktree without user consent or notification, causing edits to diverge from the user's working directory. Uncommitted changes are not visible to Claude, risking wasted work or confusion. At minimum, this should require explicit opt-in or display a clear warning." The "silent" and "without consent" aspects make it a bug in user experience, even if the underlying implementation is intentional. A feature that can cause data confusion without warning is a bug.

What Should Happen?

At least a notification/explanation that this is what's happening when I start the chat.

However, I'd prefer this to be entirely opt-in.

I have enjoyed the inline (within VSCode) experience of Claude Code so far -- in particular editing and collaboration on live uncommitted files in main (or other current branch chosen by me) in original folder -- but would love the centralized history and other features in the new desktop app. So essentially I believe the desktop app should work that way, or at least have the option to.

The git worktree requirement is extra work to have to keep merging Claude's changes back into my main branch. The option to just work in the main branch together would be ideal, and in turn would resolve the "silent" and "without consent" part, anyway.

Error Messages/Logs

Steps to Reproduce

I'm on macOS 26.0.1, VSCode 1.106.3, Claude for Mac "1.0.1307 (1ed883) 2025-11-25T21:34:53.000Z")

• If not already, switch to Claude Code in the desktop app (the little </> icon)
• Hit the (+) icon to start a new chat/session.
• From the "Select Folder" drop down, choose a folder with code files and a git database in it, that includes uncommitted changes in the files.
• Ensure the dropdown to the right of that is set to "Local worktree".
• Enter a message asking for a change.

It will make said change, but the changes are made in a new branch, based on the last commit, and any uncommitted changes are excluded. No warning that it's a new branch and therefore potential data loss is possible if user doesn't realize it's a new branch.

(Understood the way this is working is probably as designed, but I DID lose some changes because I DIDN'T realize this is what it was doing. I've been using Claude Code within VSCode before now, and so I had no reason to believe it behave significantly differently. Also, I'm a fairly basic git user. I use git for basic version control, and almost never use multiple branches. I've never used "check out" before, and so I didn't understand that's what it was doing until after I realized the data loss and ... well, thankfully Claude explained it all to me and I figured it out. For what it's worth Claude agreed with me that this is a potential danger 😉).

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude for Mac 1.0.1307 (1ed883) 2025-11-25T21:34:53.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

macOS 26.0.1
VSCode 1.106.3
MacBook Pro, M2 Max, 16".

View original on GitHub ↗

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