[BUG] Cowork: spawn ENAMETOOLONG at session initialization on Windows (MSIX) — Code tab works in same build/account

Status Closed — duplicate
Reported on v2.1.227
Maintainer reply None cached
Activity 2 comments · opened Aug 13, 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?

<html>
<body>
<!--StartFragment--><p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="11:1-13:11;156-325">Every Cowork session on Windows fails immediately with <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">spawn ENAMETOOLONG</code>. The
failure happens during <strong>session initialization</strong>, before any user content is
processed.</p>

<p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="15:1-18:72;327-632"><strong>Key isolation: the Code tab in the same app, same build, same account, same
machine works normally.</strong> Only Cowork fails. This distinguishes the issue from
#72725 (Code tab failing) and means the cause is specific to what the Cowork
launch path adds, not to subprocess spawning generally on this machine.</p>

<p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="20:1-21:53;634-763">The error originates in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">ZJ.spawnLocalProcess</code>, called from <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">ZJ.initialize</code>.
Diagnostics from <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">main.log</code> for each failed session:</p>

<div dir="ltr" class="overflow-x-auto w-full px-2 mb-6 print:overflow-x-visible" data-sourcepos="23:1-36:41;765-1268">
Field | Value
-- | --
unhealthy_reason | initialization_failed
error_message | spawn ENAMETOOLONG
had_first_response | false
session_built_prompt | true
transcript_size_bytes | undefined
is_resume | false
seconds_to_outcome | 4–7
host_loop_mode | true
msix_identity_source | native_ok
msix_fs_virtualized | true
cli_binary_source | pending (sometimes required_version)
variant_key | 07_16_2026.replace

</div>

<p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="38:1-40:13;1270-1442">Because <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">had_first_response: false</code> and <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">transcript_size_bytes: undefined</code>, no
conversation content is involved — retrying the message or starting a fresh task
cannot help.</p>

<p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="42:1-44:7;1444-1608">Two observations from the config object logged immediately before each failure,
in case they are relevant to the length of the spawn arguments or environment
block:</p>

<ol dir="ltr" class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3 print:block print:space-y-1" data-sourcepos="46:1-53:105;1610-2229">
<li class="font-claude-response-body whitespace-normal break-words pl-2" data-sourcepos="46:1-51:55;1610-2044"><strong>The environment block passed to the child has 64 keys</strong> (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">envKeys</code> array
reports <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">[length]: 64</code>), including <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CODE_OAUTH_TOKEN</code>,
<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CODE_OAUTH_SCOPES</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CODE_TAGS</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">GIT_CONFIG_PARAMETERS</code>, and
<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">OTEL_RESOURCE_ATTRIBUTES</code>. On Windows the environment block shares a size
ceiling with the command line in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CreateProcess</code>. My own <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">PATH</code> is only 572
characters, so nearly all of this is app-generated.</li>
<li class="font-claude-response-body whitespace-normal break-words pl-2" data-sourcepos="52:1-53:105;2045-2229"><strong><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CONFIG_DIR</code> is ~180 characters</strong>, composed by nesting three UUIDs:
<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Users\&lt;user&gt;\AppData\Roaming\Claude\local-agent-mode-sessions\&lt;uuid&gt;\&lt;uuid&gt;\local_&lt;uuid&gt;\.claude</code></li>
</ol>

<p class="font-claude-response-body break-words whitespace-normal" dir="ltr" data-sourcepos="55:1-56:48;2231-2359">Values are redacted in the log, so I cannot measure the actual assembled command
line or environment block from the client side.</p><!--EndFragment-->
</body>
</html>

What Should Happen?

Starting a Cowork task should initialize the session and spawn the local process without error, the same way the Code tab does in the same build.

Error Messages/Logs

[info] [MsixSpawnDiag] session start: identity_source=native_ok fs_virtualized=true cli_binary_source=pending probe=pending
[error] Session initialization failed for local_<uuid>: spawn ENAMETOOLONG { errno: -4064, code: 'ENAMETOOLONG', syscall: 'spawn', stack: 'Error: spawn ENAMETOOLONG
    at ChildProcess.spawn (node:internal/child_process:441:11)
    at spawn (node:child_process:810:9)
    at ZJ.spawnLocalProcess (C:\Program Files\WindowsApps\Claude_1.28929.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index2.chunk-DiaQ9Xz9.js:95:4076)
    at ZJ.initialize (...index2.chunk-DiaQ9Xz9.js:95:9191)
    at new ZJ (...index2.chunk-DiaQ9Xz9.js:95:3376)
    at R9 (...index2.chunk-DiaQ9Xz9.js:128:195540)
    at Object.H9 (...index2.chunk-DiaQ9Xz9.js:129:474)
    at Cs (...index.chunk-eRCJ8EOQ.js:181:609)
    at async Ds (...index.chunk-eRCJ8EOQ.js:181:16023)' }
[info] [Lifecycle] Session local_<uuid>: initializing → idle
[info] [CycleHealth] Unhealthy cycle: { unhealthy_reason: 'initialization_failed', error_message: 'spawn ENAMETOOLONG', had_first_response: false, session_built_prompt: true, host_loop_mode: true, ... }


Log location (MSIX-virtualized): %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\logs\main.log

Reproduced across multiple sessions on 2026-08-12 and 2026-08-13, with distinct session IDs each time and identical output.

Steps to Reproduce

Windows 11, Claude Desktop 1.28929.0.0 installed via MSIX.

  1. Open the Cowork tab.
  2. Start a new task. Optionally tick "Work in a Folder" and select any folder.
  3. Send any message, however short.
  4. Result: spawn ENAMETOOLONG within 4–7 seconds. The task never executes; no files are read or written.
  5. Open the Code tab in the same app and start a chat.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.227

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Ruled out locally
Workspace path length and location — tested a freshly created C:\cwtest (10 chars, no spaces, not under the user profile, empty). Same error.
Space in the Windows username — the default workspace was under C:\Users\<user with space>\Claude; moving off it changed nothing.
Environment size on my side — $env:PATH.Length = 572.
Plugins / skills / connectors — none installed or enabled.
Missing or unstaged CLI binary — despite cli_binary_source: 'pending', the binary is present and verified: ...\LocalCache\Roaming\Claude\claude-code\2.1.227\claude.exe (292,227,232 bytes) alongside a .verified marker, plus a matching claude-code-vm\2.1.227\.
Conversation size / message content — failure precedes any response (had_first_response: false).
LongPathsEnabled registry fix — reported ineffective in #64551; also irrelevant, since it governs file path length rather than command-line length.

Workaround in use

Running the staged binary directly from a terminal works:

powershell
& "$env:LOCALAPPDATA\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude-code\2.1.227\claude.exe"

The Code tab also works. Only the Cowork tab is affected.

Environment
OS: Windows 11
Claude Desktop: 1.28929.0.0 (MSIX, C:\Program Files\WindowsApps\Claude_1.28929.0.0_x64__pzs8sxrjxfjjc)
Claude Code version: 2.1.227
Shell: PowerShell
variant_key: 07_16_2026.replace
Related issues
#64551 — same error in Cowork, closed as duplicate. Reported on Desktop 1.9659.2.0; this report is on 1.28929.0.0, so the bug has survived many releases.
#60669 — same error in Cowork; reporter found it followed the account across two different machines while a new account worked on the same install. If a server-assigned variant influences the launch config, that would explain it, which is why variant_key is included above.
#72725 — spawn ENAMETOOLONG in the Code tab. Likely distinct: my Code tab works.
#47306 — spawn ENAMETOOLONG from gitDiff. Distinct: no gitDiff entries appear near my failures.

View original on GitHub ↗

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