[BUG] /desktop fails on Windows - "Failed to open Claude Desktop" despite app being installed and running
Status Closed — duplicate
Reported on v2.1.143
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened May 16, 2026 · closed Aug 25, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The /desktop command in Claude Code CLI always fails with "Failed to open Claude Desktop. Please try opening it manually." even though Claude Desktop is fully installed and running.
What Should Happen?
/desktop should detect Claude Desktop and open it successfully.
Error Messages/Logs
> /desktop
Error: Failed to open Claude Desktop. Please try opening it manually.
Steps to Reproduce
- Install Claude Desktop on Windows 11 (fresh install)
- Verify Claude Desktop opens manually - it works fine
- Open Claude Code CLI
- Type /desktop
- Error appears every time
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.143 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- AnthropicClaude folder exists at correct path
- claude.exe found at: %LOCALAPPDATA%\AnthropicClaude\app-1.7196.1\claude.exe
- Claude Desktop runs fine manually (10 processes visible in Task Manager)
- Tried creating symlink at %LOCALAPPDATA%\AnthropicClaude\claude.exe - did not help
- Tried CLAUDE_DESKTOP_PATH environment variable - did not help
- Reinstalled Claude Desktop multiple times - same result every time
Showing cached comments. Read the full discussion on GitHub ↗
9 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
claude-code #59824 — /desktop Fails on Windows
Issue
URL: https://github.com/anthropics/claude-code/issues/59824
Title: /desktop fails on Windows — "Failed to open Claude Desktop" despite app installed
Severity: Medium — desktop integration broken
Labels: bug, platform:windows, area:cli, area:desktop
Affects: Windows users trying to open Claude Desktop from CLI
Root Cause Analysis
The
/desktopcommand fails to detect Claude Desktop on Windows even when it's installed and running. This is a regression — it worked in a previous version.claude://orclaude-desktop://protocol handler may not be registeredProposed Fix
Impact
Update: After adding HKLM registry entry with the shim executable, /desktop now opens Claude Desktop successfully. However it then shows "CLI session transcript not found: <session-id>".
Investigation shows a path mismatch:
These are completely different paths and formats. The CLI uses simple files like "29056.json" while Desktop expects a folder structure with manifest.json inside.
So there are actually two separate bugs:
i think that Both need to be fixed on Anthropic's side.
Confirming this bug is still present on the latest Claude Code and Claude Desktop as of 2026-05-25 — over a week after #61194 was filed and auto-closed as a duplicate of this thread.
Environment
Claude_1.8555.2.0_x64__pzs8sxrjxfjjc(installed via the.exeinstaller from https://claude.ai/download — which delivers as MSIX)Symptom
/desktop→Error: Failed to open Claude Desktop. Please try opening it manually.Verified working alternatives on the same machine (so install + protocol handler are healthy, the CLI launcher is the broken piece):
Start-Process "claude://"→ opens the appStart-Process "shell:AppsFolder\Claude_pzs8sxrjxfjjc!Claude"→ opens the appThe MSIX-aware diagnosis in this issue still matches current behaviour exactly. The official installer at https://claude.ai/download continues to deliver Claude Desktop as an MSIX package, so every new Windows install hits this immediately on first
/desktop.having the same issue on Windows. can't move sessions to the desktop app.
Root cause found (for at least a subset of reports here): bare
cmdresolution failure with session-lifetime negative cache — same defect class as #67156, different symptomTL;DR: On Windows,
/desktoplaunches the deep link by spawning the bare command name"cmd". That name goes through an internal resolver that runswhere.exeand permanently caches anullresult for the whole session ifwhere.exeever exits 1. Once that happens, every/desktopin the session returns a fabricated exit code 127 without ever spawning anything, and the user sees the generic "Failed to open Claude Desktop. Please try opening it manually." — even though the Desktop app, theclaude://protocol handler, and the deep-link mechanism are all perfectly healthy. This is exactly the mechanism documented in #67156 for bare"git"inExitWorktree;/desktopis a second symptom surface of the same defect.Environment (forensics machine)
~\.local\bin\claude.exe); failures observed on 2.1.17x, all code excerpts below decompiled from the shipped 2.1.173 binaryClaude_…_pzs8sxrjxfjjc),claude:protocol declared in the package manifest and registered underHKCU:\Software\Classes\claudeThe code path (2.1.173 bundle, minified names as found)
/desktoporchestration (Ai_):The launcher spawns bare
"cmd":F6→Iqresolves bare names throughegH→x7qbefore spawning:and
Iqfabricates a result without spawning anything when resolution returnsnull:127 !== 0→Lk5returns false → the generic error above. This is byte-for-byte the same resolver/cache/fabrication chain as #67156 (x7q/C7q/Iq/egHin 2.1.173 ≡ag6/og6/Jq/Wm8in the 2.1.146/2.1.150 bundles analyzed there), confirming the defect is still present in the latest release.The differential fingerprint that pins it
The same
/desktopinvocation resolves two bare names:"reg"(detection) and then"cmd"(launch). On the affected session, the user-visible error was "Failed to open…", not "Claude Desktop is not installed…" — meaningwhere.exe regsucceeded seconds (or milliseconds) beforewhere.exe cmdallegedly failed, in the same process with the samePATH. Both binaries live inSystem32. A live environment in whichregresolves andcmddoes not, simultaneously, does not exist — but a stale negative cache entry for"cmd", poisoned at some earlier moment of the session (one transientwhere.exeexit-1, e.g. during a momentary PATH anomaly at startup), reproduces exactly this asymmetry, instantly and for the rest of the session.Forensic timeline (one affected session, four failures)
| Event (UTC, from session transcript / Desktop
main.log) | Result ||---|---|
| 15:02:50
/desktop| "Failed to open Claude Desktop" || 15:02:58
/desktop(retry) | same error || 15:03:12 Desktop app started manually, protocol handlers (re)registered | — |
| 15:03:30
/desktop— 18 s after Desktop startup, registration fresh, app running | same error || 18:15:56
/desktop(hours later, app still running) | same error |Across all four failures, Desktop's
main.logcontains zero deep-link arrivals and Windows Defender logged zero blocks — the launch never spawned, consistent with the fabricated-127 path and inconsistent with every registry/MSIX/activation theory.What was ruled out (verified working on the same machine)
cmd /c start "" claude://resume?session=<id>was replayed with identical argv from PowerShell and from Node (child_process.spawnSync, same libuv backend), with the project directory on a secondary drive andwindowsHideboth on and off: exit 0 in all six combinations, and each link's arrival is visible in Desktop'smain.log(Resume deep link: missing or invalid session { sessionId: '<test-id>' }).reg query HKEY_CLASSES_ROOT\claude, which the Store package satisfies) — so the%LOCALAPPDATA%path shims from #59692/#59883 address a code path that no longer exists.cmd.exeAutoRun,claude://registration staleness across an MSIX auto-update, AV interference: all checked, all inert.Version note re #65996
#65996 correctly identified an ampersand-splitting bug in 2.1.168, where the deep link was
claude://resume?session=…&cwd=…. In the 2.1.173 bundle the only resume-link builder isnew URL("claude://resume"); searchParams.set("session", H)— thecwdparameter is gone and the URL contains no&, so that failure mode appears to have been silently fixed./desktopfailures persisting on ≥2.1.173 are therefore a different bug — the one described here.Suggested fixes (aligned with #67156)
cmdthrough PATH at all. The resolver already builds an absolute path forwhere.exeitself (%SYSTEMROOT%\System32\where.exe); spawn%SYSTEMROOT%\System32\cmd.exe(or%COMSPEC%) the same way. PATH lookup for a fixed system binary adds failure modes and zero value. (Better yet: open the URL via a native ShellExecute equivalent and skipcmdentirely — that would also have prevented the #65996 class.)Command 'cmd' not found or is in an unsafe locationinstderr, and the failure object already carriesdeepLinkUrl— showing either of these instead of the generic message would have made this diagnosable from the first report, and gives users a copy-pasteable manual fallback.Workarounds for affected users (no shims, no registry edits)
/desktopagain; orWin+R→claude://resume?session=<your-session-id>(session id via/status). This is exactly what/desktopwould have launched.+1, reproducing on Windows 11 with Claude Code 2.1.186 (so still broken past 2.1.143).
In my case the root cause looks broader than the versioned-subfolder path discussed above. I have Claude Desktop installed from the Microsoft Store (MSIX), not the standalone installer — so
%LOCALAPPDATA%\AnthropicClaude\does not exist at all on my machine. Desktop runs fine; it just lives at:Claude_pzs8sxrjxfjjcClaude%LOCALAPPDATA%\Microsoft\WindowsApps), so there is noclaude.exe/Claude.exeshim to call by name./desktopappears to only probe the standalone%LOCALAPPDATA%\AnthropicClaude\…\claude.exepath, with no fallback for Store/MSIX installs — which can't be launched by raw exe path anyway (they needexplorer.exe shell:AppsFolder\Claude_pzs8sxrjxfjjc!Claude, or a registered URL/protocol handoff). So on a Store install/desktopcan never succeed. The symlink andCLAUDE_DESKTOP_PATHworkarounds in this thread don't apply, since there's no standalone exe to point at.Use case, for context: I'm not trying to merely launch the app (that works) — I'm trying to transfer/continue my CLI session in Desktop's Claude Code, and
/desktopis the only entry point for that handoff.Suggested fix: detect the MSIX install (e.g.
Get-AppxPackage Claude*, package familyClaude_pzs8sxrjxfjjc) and launch viashell:AppsFolder\<PackageFamilyName>!<AppId>or aclaude://-style protocol handoff, rather than assuming the standaloneAnthropicClaude\…\claude.exepath exists.Follow-up — I switched from the Store/MSIX build to the standalone installer and ruled out every environmental cause, and
/desktopstill fails. Data points (Windows 11, Claude Code 2.1.186):claude.exeis now at%LOCALAPPDATA%\AnthropicClaude\app-1.14271.0\claude.exe(plus the stub at
%LOCALAPPDATA%\AnthropicClaude\claude.exe).claude://URL protocol handler is registered:HKCU\Software\Classes\claude\shell\open\command→"…\AnthropicClaude\app-1.14271.0\claude.exe" "%1"/desktopstill returns:Failed to open Claude Desktop. Please try opening it manually.So it isn't the install path, the protocol registration, or Desktop being closed — with all three satisfied it still fails. The failure is in the CLI's
/desktoplaunch logic itself on Windows. (Reported as a regression — it worked in an earlier version.) Hope that narrows it down for whoever picks this up.I had this same issue. I fixed it by going into the registry, HKCU\Software\Classes\claude. I had (Default) and URL Protocol listed there. But only (Default) had data, URL:claude. I put URL:claude as the value for URL Protocol.
Worked after a restart of claude cli