anthropics / anthropics/claude-code

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

Đang mở
#92,210 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:desktop bug has repro platform:windows
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
desktop
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.