[BUG] Desktop (Windows): every claude://code/new?folder= link shows the workspace trust prompt, even for an already-trusted folder

Open
#111,488 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
electron, typescript
Domain
desktop, security

Research direction

Start by locating the main-process code/new handler and confirm where it adds src=external and forwards only q, folder, src, environment and runner_pool. Then trace the renderer path that decides whether to show the workspace trust prompt, and compare it with the LocalSessions.checkTrust and LocalSessions.saveTrust records described in the logs. Reproduce with Start-Process "claude://code/new?folder=...&q=hello" on a folder already trusted from the Code tab. Done means an already-trusted folder opens without the prompt, while an untrusted folder still asks once.

Written by the indexing model from the issue text.

Description

area:desktop area:permissions bug platform:windows

Environment

  • Claude desktop 6.28899.2.0 (Windows 11, Microsoft Store/MSIX build)
  • Claude Code 2.1.328 (bundled)

Summary

Every claude://code/new?folder=<path>&q=<prompt> link shows the workspace trust prompt for <path>. This happens even when the app has just reported the folder as trusted. Accepting the prompt does not stick: the next link to the same folder asks again.

Steps to reproduce

  1. Use a folder you already work in from the Code tab, so it is trusted (main.log shows LocalSessions.checkTrust: cwd=<folder> followed by LocalSessions.checkTrust: trusted=true).
  2. From another process, open claude://code/new?folder=<url-encoded absolute folder>&q=hello (for example Start-Process "claude://code/new?...", or os.startfile(url) in Python).
  3. The new-session page asks you to trust <folder>. Accept it.
  4. Open the same link again.

Expected

No trust prompt for a folder that is already trusted, or at most one prompt per folder.

Actual

The prompt appears on every link. Each acceptance logs a new save for the same folder:

[info] LocalSessions.checkTrust: cwd=<folder>
[info] LocalSessions.checkTrust: trusted=true, sources=1
... (link opened: second-instance)
[info] LocalSessions.saveTrust: cwd=<folder>
[info] Saved workspace trust for <folder>
... (next link, a few minutes later)
[info] LocalSessions.saveTrust: cwd=<folder>
[info] Saved workspace trust for <folder>

About 14 hours of main.log contain 116 outside launches of the app (second-instance events, not counting resume links). 66 of them were followed by a saveTrust within two minutes, before the next launch. In 62 of those 66, no checkTrust line was logged between the launch and the save. One folder was saved three times in about eight minutes.

Notes from the bundled code (may be wrong)

  • The main-process code/new handler appends src=external whenever folder (or the ssh_* parameters) is present. It forwards only q, folder, src, environment and runner_pool to the renderer, so a link cannot carry anything that affects trust.
  • The renderer then shows the trust prompt without consulting the stored trust that checkTrust reports, or it reads a different record than saveTrust writes.
  • No setting turns this off.

Impact

Local tools that start Code sessions through claude://code/new (task runners, todo launchers) need a manual click on every launch, even in folders the user trusted long ago.

Request

Honor existing workspace trust for src=external links (the prompt is still right for folders that were never trusted), or add a setting that allows deep links into already-trusted folders without the prompt.

Related

  • #106542 (macOS: the same handler drops folder and shows no prompt at all)
  • #77750 (closed as stale: grant trust through settings or deep links)
Dominant language
TypeScript
Stars
156k
Forks
25k
Avg merge
16h 19m
Merged PRs (30d)
5

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.