anthropics / anthropics/claude-code

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

Ouverte
#92,210 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:desktop bug has repro platform:windows
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

## 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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Domaine
desktop
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.