[BUG] spawn ENAMETOOLONG

Resolved 💬 4 comments Opened Jun 1, 2026 by netsurfer404 Closed Jun 5, 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?

Bug Report: spawn ENAMETOOLONG on Cowork workspace connection — Windows 11
Posted by: Stefan (MGC Transport) | Claude Desktop v1.9659.2.0 | Windows 11

The Error
Every time I attempt to connect a local workspace folder to Cowork, the app immediately throws:
spawn ENAMETOOLONG
The error fires on every attempt without exception — new tasks, existing tasks, empty tasks. Cowork is completely non-functional for me as a result.

My Environment

OS: Windows 11
Claude Desktop version: 1.9659.2.0
Install path: C:\Program Files\WindowsApps\Claude_1.9659.2.0_x64__pzs8sxrjxfjjc\app\Claude.exe
Workspace folder I am trying to connect: C:\Claude (10 characters — not the source of the problem)
Account type: Pro

What I Tried

Enabled Windows long path support via registry — ran the PowerShell command to set LongPathsEnabled = 1 in HKLM\SYSTEM\CurrentControlSet\Control\FileSystem. Applied multiple times across multiple sessions and rebooted after each attempt. No change.
Reduced folder depth inside C:\Claude — removed nested directories and node_modules folders to reduce overall file count and path depth inside the workspace. No change.
Verified the workspace path length is not the issue — C:\Claude is 10 characters, well within any limit. The problem is not the folder I am pointing to.
Attempted multiple Cowork sessions — new sessions, existing sessions, empty sessions. The error fires every time regardless.

Root Cause — Based on Research
After investigating, this is not a user-fixable problem. The issue is that Cowork constructs a subprocess command that includes a large system prompt as a command-line argument. On Windows, the CreateProcess API has a hard limit of approximately 8,191 characters for a spawned command. The combined length of the Claude install path, command flags, and system prompt exceeds this limit.
The Windows long path registry fix does not affect this limit. That fix only addresses file path length, not command-line argument length. No local configuration change resolves this.

Current Status
Cowork is completely unusable on my machine. I have exhausted all suggested workarounds. This requires a fix on Anthropic's side — specifically, the system prompt should not be passed as a command-line argument. It should be written to a file and passed by reference, or handled through another mechanism that does not hit the Windows CreateProcess character limit.

Request
Please prioritize a fix for Windows users. This is a blocking issue that makes Cowork entirely inaccessible.

What Should Happen?

When the fix is in place, connecting C:\Claude as a Cowork workspace should work without any errors. Specifically:

You point Cowork to C:\Claude
It connects successfully
Tasks spawn and execute without throwing ENAMETOOLONG
Cowork can read your memory files, work inside your project folders, and produce outputs as intended

Error Messages/Logs

spawn ENAMETOOLONG

Steps to Reproduce

Steps to Reproduce

Install Claude Desktop on Windows 11 from claude.com/download. The app will install to C:\Program Files\WindowsApps\Claude_[version]_x64__pzs8sxrjxfjjc\
Open Claude Desktop and navigate to the Cowork section using the sidebar.
Create a simple test folder on your C drive:

C:\Claude

Inside C:\Claude, create a minimal folder structure:

C:\Claude\
C:\Claude\memory\
C:\Claude\Projects\
C:\Claude\Output\

In Cowork, click to create a new task or open an existing one.
When prompted to connect a workspace folder, point Cowork to C:\Claude.
Attempt to run any task — new, existing, or empty.

Result:
Something went wrong
spawn ENAMETOOLONG
The error fires immediately. The task does not execute. No files are read or written.
Expected Result:
Cowork connects to C:\Claude, reads the workspace contents, and executes the task without errors.

Additional Notes for Reproduction

The workspace folder path length is irrelevant. C:\Claude is 10 characters. Even a single-word folder name at the root of C produces the same error.
The Windows long path registry fix does not resolve it:

powershellNew-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Rebooting after applying the fix makes no difference.
The error is reproducible on every attempt without exception — no intermittent behaviour.
The issue is not account-tier specific. Reported on both Pro and Max accounts by multiple users.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.159

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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