[BUG] Desktop (Windows): new sessions silently start in a worktree after the environment-picker update; no setting to turn it off
Preflight Checklist
- [x] I have searched existing issues. The closest is #53545 ("Desktop app: no way to disable auto-worktree for new sessions"), closed for inactivity and not fixed. This is still happening, and the new environment picker makes it worse.
What's Wrong?
Since the desktop update that added the "Choose environment" picker (2.37337.1, Oct 13–14 — see #102088), every new Code-tab session I start from my project's environment is created inside a git worktree (<project>\.claude\worktrees\<name>) on an auto-named claude/<name> branch. I never asked for a worktree. Before this update, hundreds of sessions in the same project started in the main checkout on master.
There is no setting to turn this off:
- Settings → Claude Code has only Worktree location (where worktrees go) and Branch prefix — nothing for whether a worktree is created.
- The new-session prompt box shows the environment picker (This computer, my project's environment, Cloud, New environment) and no worktree toggle that I can find.
- The docs (https://code.claude.com/docs/en/desktop) mention a "worktree option next to the branch name" and do not describe saved environments, "Save as environment", or any default.
What the app's own local files show (Windows, %APPDATA%\Claude):
ccd-session-presets.jsonholds one preset for my project, created automatically on Oct 14 ("seededFromDraft": true), with no worktree value of its own. ItsbuiltIns.local.settingsreads"worktree": true, along with a model I had used in one earlier session. I had turned the worktree option on exactly once, days earlier, for one deliberate branch session. That one-time choice appears to have become the permanent default for every later session.- Each session's record in
claude-code-sessions\…\local_*.jsoncarriesstartedFromEnvironmentId. Every session started from the preset got a worktree. Every session withstartedFromEnvironmentId: "null"(started from This computer, then moved into the project folder) ran in the main checkout. - Setting
"worktree": falseinccd-session-presets.jsondoes not stick: the app rewrites the file from its own copy on the next restart.
The result: sessions silently work on a branch I didn't create, while I believe they're on master. Commits land there. Another session's instructions, CLAUDE.md files and documents differ from the main checkout, because the worktree is cut from wherever the branch point was.
What Should Happen?
- A visible setting, e.g. Settings → Claude Code → "Create a worktree for new sessions", that applies to every environment, including saved/auto-created presets.
- Choosing a worktree once, for one session, should not silently become the default for all future sessions.
- If a session is going to start in a worktree, the prompt box should show that clearly before the session starts, with a way to turn it off for that session.
Error Messages/Logs
None — no error is shown. The session simply starts in .claude\worktrees\<name> on branch claude/<name>.
Steps to Reproduce
- In the Code tab, start one session with the worktree option on (e.g. to work on a feature branch).
- Update to 2.37337.1 or later (the build that adds the "Choose environment" picker).
- Click New, pick the project's environment in Choose environment, type a prompt, and send.
- The session is created in
<project>\.claude\worktrees\<name>onclaude/<name>, not in the main checkout. - Look for a setting to stop this: none exists. Edit
%APPDATA%\Claude\ccd-session-presets.jsonto set"worktree": false, then restart the app: the value is restored totrue.
Workaround: pick This computer, then ask the session to move into the project folder. It then runs in the main checkout.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
The desktop version before 2.37337.1 (sessions started in the main checkout)
Claude Code Version
Desktop 2.42304.0 (Windows Store build)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Related: #53545 (same request, closed for inactivity), #102088 (the same update regrouped the sidebar by environment).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗