[BUG] /desktop fails on Windows: `&` in deep link URL not escaped for cmd.exe

Resolved 💬 2 comments Opened Feb 16, 2026 by sabbasi3 Closed Mar 21, 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?

## Description

The /desktop command always fails on Windows with:
> "Failed to open Claude Desktop. Please try opening it manually."

This happens even when the Desktop app is installed, running, and signed into the same account.

## Root Cause

The CLI opens the deep link via:
``js
cmd /c start "" "claude://resume?session=X&cwd=Y"
``
On Windows, cmd.exe interprets & as a command separator, even inside double quotes. So the command is split into:

  1. start "" "claude://resume?session=X" — opens partial URL
  2. cwd=C:\Users\... — treated as a separate command, which fails

This causes exit code 1, so lQE() returns false and the error is shown.

Evidence

> cmd /c start "" "claude://resume?session=test&cwd=C:\Users\test"
'cwd' is not recognized as an internal or external command,
operable program or batch file.

Using PowerShell's Start-Process "claude://resume" works and successfully opens the Desktop app.

What Should Happen?

The /desktop command should successfully hand off the current CLI session to the Claude Desktop app and open it in the Code tab.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

Replace the current content (move the suggested fix to Additional Info):

  1. Install Claude Desktop on Windows (v1.1.3189)
  2. Open the Desktop app and sign in
  3. Open the Code tab
  4. In a separate terminal, start a Claude Code CLI session (claude)
  5. Run /desktop in the CLI session
  6. Observe error: "Failed to open Claude Desktop. Please try opening it manually."

The issue is in the lQE() function which calls:
```js
cmd /c start "" "claude://resume?session=X&cwd=Y"
The & in the URL is interpreted by cmd.exe as a command separator.

Suggested Fix

Either:

  1. Escape & as ^& when building the cmd.exe command: cmd /c start "" "claude://resume?session=X^&cwd=Y"
  2. Use PowerShell Start-Process instead of cmd /c start on Windows
  3. Use Node.js child_process with shell: false and open package

Environment

  • CLI version: 2.1.44
  • Desktop version: 1.1.3189
  • OS: Windows 11 Enterprise 10.0.26200
  • Desktop install path: C:\Users\<user>\AppData\Local\AnthropicClaude\app-1.1.3189\
  • Registry: HKCR\claude protocol handler is correctly registered
  • Desktop was running: Yes, on the Code tab, signed in with same account

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.44 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗