[BUG] Claude Desktop (Windows MSIX): Dispatch/Cowork host sessions fail with "native binary … failed to launch" because host-cwd exceeds MAX_PATH

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 1 comment · opened Sep 28, 2026

Environment

  • Claude Desktop 2.9939.4.0 (MSIX, Claude_pzs8sxrjxfjjc), bundled Claude Code 2.1.284
  • Windows 11 Business, build 26200, LongPathsEnabled = 0
  • User profile: C:\Users\<user>, where the profile folder name is 20 characters long

Symptom
Dispatch messages from the phone arrive ([sessions-bridge] Received user message), but every turn fails immediately with isError=true and no reply:

Claude Code native binary at C:\Users\<user>\AppData\Roaming\Claude\claude-code\2.1.284\claude.exe exists but failed to launch.
This usually means the binary does not match this system's libc … (ENOENT)
error_category: 'sdk_binary_missing', host_loop_mode: true, msix_fs_virtualized: true, msix_identity_source: 'native_ok'

Root cause
The [HostLoop] spawn uses this working directory:

C:\Users\<user>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\local-agent-mode-sessions\<accountId>\<orgId>\agent\local_ditto_<orgId>\host-cwd

With a 20-character profile name, the path is 263 characters, which exceeds MAX_PATH. CreateProcess rejects an lpCurrentDirectory longer than MAX_PATH with ERROR_DIRECTORY (267). libuv reports that as ENOENT, and the SDK then shows the misleading libc hint (same class as #97275).

The exact limit is not pinned down. The only data points are 263 characters (fails) and the 237-character variant below (works). Profile names of roughly 17 or more characters are likely affected.

Repro (PowerShell, no app needed)

$exe  = "$env:LOCALAPPDATA\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude-code\2.1.284\claude.exe"
$long = "<the 263-char host-cwd above>"
$psi  = New-Object System.Diagnostics.ProcessStartInfo $exe, '--version'
$psi.UseShellExecute = $false
$psi.WorkingDirectory = $env:TEMP; [Diagnostics.Process]::Start($psi)   # works: 2.1.284 (Claude Code)
$psi.WorkingDirectory = $long;     [Diagnostics.Process]::Start($psi)   # fails: Der Verzeichnisname ist ungültig (267)

The same length problem also shows up as Failed to write cowork-plugin-mcp-shadow.json … Root is not an accessible directory (292 chars).

Workaround (confirmed)

  • Create a junction C:\U → C:\Users\<user>.
  • Launch the app via the execution alias claude-desktop.exe with USERPROFILE=C:\U and LOCALAPPDATA=C:\U\AppData\Local.
  • rD() then builds physicalRoaming from the shorter USERPROFILE, and host-cwd becomes 237 characters.
  • Result: Dispatch works (isError=false). Package identity is preserved (native_ok).

Suggested fixes

  • Use a short cwd for host-loop spawns, e.g. a hashed or short ID instead of local_ditto_<orgId>, or a directory under %TEMP%.
  • Or pass the 8.3 short path for the cwd.
  • Validate cwd length/existence before spawn and report it instead of the libc hint (#97275).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗