anthropics / anthropics/claude-code

Desktop 1.46388: claude://code/new?folder= starts a scratch workspace when the folder equals the currently selected folder

Aperta
#92,210 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:desktop bug has repro platform:windows
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

## Environment

- Claude Desktop 1.46388.3 (Windows 11, Microsoft Store / MSIX package), bundled engine 2.1.260
- Also verified: 1.37937.3 and 1.40609.0 did **not** have this behaviour (same links worked on 2026-08-27 and 2026-08-28)

## What happens

Opening a deep link `claude://code/new?folder=&q=` shows the "Trust this workspace?" dialog for the right folder. After clicking "Trust workspace", the composer chip shows the folder and the prompt is prefilled. Pressing Enter starts the session in a freshly minted **scratch workspace** (the "No folder" list) instead of the folder. The prompt text arrives intact.

`%LOCALAPPDATA%\Claude\Logs\main.log` for one click:

```
15:46:55 [info] LocalSessions.checkTrust: cwd=C:\Users\\cases\
15:46:57 [info] LocalSessions.saveTrust: cwd=C:\Users\\cases\
15:46:57 [info] Saved workspace trust for C:\Users\\cases\
15:47:17 [info] LocalSessions.createScratchWorkspace
15:47:17 [info] [CCD] minted scratch workspace C:\Users\\AppData\Roaming\Claude\scratch-workspaces\...\scratch-2026-09-04-43ac21
15:47:18 [info] Starting local session local_... in C:\Users\\AppData\Roaming\Claude\scratch-workspaces\...\scratch-2026-09-04-43ac21
```

## Trigger

The folder in the link is the **same string** as the folder already selected in the composer (the folder of the last local session, or one picked manually). When the selected folder is different, the very same link works — the log then shows `saveTrust` → `checkGhAvailable: cwd=` → `Starting local session ... in `.

A different spelling of the same path (`C:/Users/...` instead of `C:\Users\...`, or a lowercase drive letter) also makes the link work, which points to a plain string comparison in the renderer. Those spellings then show up as separate groups in the sidebar, so this is not a usable workaround.

## Steps to reproduce

1. Start any session in folder X from the sidebar (or pick X in the composer).
2. Open `claude://code/new?folder=&q=hello` (e.g. `Start-Process` in PowerShell).
3. Click "Trust workspace" on the dialog.
4. Press Enter.

Expected: session starts in X. Actual: session starts in `%APPDATA%\Claude\scratch-workspaces\...`, listed under "No folder".

Reproduced 4 times in a row on the same machine; opening a *different* folder via the same link right before makes the next attempt succeed.

## Why it matters

We launch Claude Desktop from an internal app with the folder of the current matter and a prefilled prompt. Users typically reopen the same folder they were just working in, which is exactly the failing case.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by tracing the claude://code/new deep-link flow around the renderer and the LocalSessions.checkTrust, saveTrust, and createScratchWorkspace entries described in main.log. Reproduce with the same selected folder and compare it with a different folder. Done means the session starts in the requested folder and no scratch workspace is created.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
desktop
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.