claude-code - 💡(How to fix) Fix [FEATURE] Desktop: add a "leave working tree as-is" option to the new-session-in-existing-worktree dialog (currently only Stash / Discard / Commit)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

None of the three is a true no-op. This makes the dialog hostile to a very common scenario: a user kept some files untracked on purpose (handoff notes, scratch files, locally-generated artifacts) precisely because they don't belong in git, and now wants to start a fresh session against the same worktree without touching those files. The worktree feature is positioned as a way to keep parallel work isolated and stable; forcing every session start through a working-tree-mutating modal undermines that promise.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Problem Statement

In Claude Desktop on macOS, starting a new session in an existing worktree that has untracked files presents a modal forcing the user to choose one of:

  • Stash
  • Discard
  • Commit

There is no "leave as-is / proceed without touching the working tree" option, no Cancel, no "Start anyway". Each of the three buttons mutates the working tree or destroys data:

  • Discard → data loss (untracked file gone)
  • Stash → working tree mutated; recoverable via git stash pop but introduces an extra step and a small race window
  • Commit → branch mutated; recoverable via git reset --soft HEAD~1 but pollutes history

None of the three is a true no-op. This makes the dialog hostile to a very common scenario: a user kept some files untracked on purpose (handoff notes, scratch files, locally-generated artifacts) precisely because they don't belong in git, and now wants to start a fresh session against the same worktree without touching those files. The worktree feature is positioned as a way to keep parallel work isolated and stable; forcing every session start through a working-tree-mutating modal undermines that promise.

Proposed Solution

Add a fourth option to the dialog — for example "Start session anyway" or "Leave working tree untouched" — that:

  • Does not run git stash
  • Does not delete anything
  • Does not create a commit
  • Simply starts a new session with the worktree in exactly its current state

This would make Desktop-app behavior symmetric with the CLI: claude started from a terminal inside the worktree does not mutate untracked files at startup. There is no reason the Desktop app should be stricter.

A Cancel button (close the dialog without starting a session) would also be welcome but is secondary; the primary ask is the no-op start option.

Alternative Solutions

  • Skip the dialog entirely when the worktree is "dirty" only in the untracked-files sense (no modified tracked files, no staged changes). Treat untracked files as intentional and start the session without prompting. The dialog could still appear when there are modified tracked files.
  • Make the dialog non-blocking — show it as a warning banner inside the new session instead, so the user can act on it (or ignore it) from within the agent context.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

  1. Working in a worktree session on a feature branch. Created a local handoff note (docs/handoff.md) that is intentionally untracked because it's a scratch file, not project content.
  2. The session's context degraded (long conversation, agent went off track). Want to start a clean new session in the same worktree to preserve all the existing branch commits and the untracked handoff note.
  3. Open a new session targeting that worktree → dialog forces Stash / Discard / Commit.
  4. Cannot proceed without touching the working tree. The only data-preserving path (Stash) requires the new agent to know to run git stash pop immediately, which adds friction and risk every single time.

Additional Context

Environment

  • macOS Darwin 25.5.0
  • Claude Desktop version: 1.8555.2 (a476c3), built 2026-05-22
  • Desktop-only workflow — the claude CLI was never used in this repo.

Related Issues (not duplicates)

  • #60624 — EnterWorktree regression: errors with '<branch>' is already used by worktree at ... instead of attaching to the existing worktree. Different phase (fails before this dialog appears), but compounds the problem: with both issues unfixed there is no clean path forward for Desktop-only users.
  • #56639 — Closed/completed. Archive destroyed worktrees with uncommitted changes. Different code path, related theme around worktree dirty-state handling.
  • #60272 — Fork session to decouple new sessions from cwd. Different concern (working-directory inheritance, not dirty state).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING