anthropics / anthropics/claude-code

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

オープン
#92,210 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:desktop bug has repro platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

領域
desktop
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。