claude-code - 💡(How to fix) Fix Claude Desktop Task mode: "Failed to create bridge sockets after 5 attempts" on macOS 26.4 [12 comments, 11 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49341Fetched 2026-04-17 08:43:59
View on GitHub
Comments
12
Participants
11
Timeline
35
Reactions
6

Task/agent mode in Claude Desktop fails to start any session on macOS 26.4. Every spawn of the in-VM claude CLI exits with code 1 within ~1s. Regular Chat mode works fine; the failure is specific to the agent-mode VM.

Error Message

From ~/Library/Logs/Claude/cowork_vm_node.log:

[Spawn:vm] Spawn succeeded in 41ms
[vm-stderr] Error: Failed to create bridge sockets after 5 attempts
[Process] Exited, code=1, duration=917ms

Root Cause

Root cause (as far as I can tell)

The VM-side CLI spawns socat TCP-LISTEN:3128 UNIX-CONNECT:/var/run/mitm-proxy.sock (HTTP bridge) and the same for port 1080 (SOCKS). Both fail. The VM itself boots cleanly, network is CONNECTED, and coworkd logs MITM proxy started on /var/run/mitm-proxy.sock, so the socket appears to exist — but the bridge setup fails deterministically.

Code Example

[Spawn:vm] Spawn succeeded in 41ms
[vm-stderr] Error: Failed to create bridge sockets after 5 attempts
[Process] Exited, code=1, duration=917ms
RAW_BUFFERClick to expand / collapse

Summary

Task/agent mode in Claude Desktop fails to start any session on macOS 26.4. Every spawn of the in-VM claude CLI exits with code 1 within ~1s. Regular Chat mode works fine; the failure is specific to the agent-mode VM.

Environment

  • Claude Desktop: 1.3036.0
  • macOS: 26.4 (Darwin 25.4.0, Apple Silicon)
  • Claude Code SDK in VM: 2.1.111

Error

From ~/Library/Logs/Claude/cowork_vm_node.log:

[Spawn:vm] Spawn succeeded in 41ms
[vm-stderr] Error: Failed to create bridge sockets after 5 attempts
[Process] Exited, code=1, duration=917ms

Root cause (as far as I can tell)

The VM-side CLI spawns socat TCP-LISTEN:3128 UNIX-CONNECT:/var/run/mitm-proxy.sock (HTTP bridge) and the same for port 1080 (SOCKS). Both fail. The VM itself boots cleanly, network is CONNECTED, and coworkd logs MITM proxy started on /var/run/mitm-proxy.sock, so the socket appears to exist — but the bridge setup fails deterministically.

Likely candidates: race between proxy socket creation and socat connect, permissions on the socket vs. the non-root session user, or a macOS 26.x Virtualization Framework regression.

Reproduction

  1. Launch Claude Desktop on macOS 26.4
  2. Start a Task mode session
  3. Session immediately fails with "error code 1"

What I've tried

  • Killed all Claude processes, reinstalled app — no change
  • Deleted ~/Library/Application Support/Claude/claude-code-vm, local-agent-mode-sessions, vm_bundles — no change
  • Full wipe of ~/Library/Application Support/Claude/ — no change

Chat mode works. claude.ai web works. Only Task mode is affected.

extent analysis

TL;DR

The issue can be potentially resolved by investigating and addressing the permissions on the MITM proxy socket or the timing of its creation in relation to the socat connection attempts.

Guidance

  • Investigate the permissions on the /var/run/mitm-proxy.sock socket to ensure they allow the non-root session user to connect.
  • Check the timing of the MITM proxy socket creation and the socat connection attempts to identify any potential race conditions.
  • Verify that the coworkd process is correctly setting up the MITM proxy and that the socket is indeed available when socat attempts to connect.
  • Consider adding logging or debugging statements to the socat command or the MITM proxy setup to gain more insight into the failure.

Example

No specific code snippet can be provided without modifying the existing codebase, but adding debug logging to the socat command, such as socat -v TCP-LISTEN:3128 UNIX-CONNECT:/var/run/mitm-proxy.sock, might help identify the issue.

Notes

The problem seems specific to the interaction between the socat command and the MITM proxy socket, and resolving it may require a deeper understanding of the socket's creation and permissions. The fact that Chat mode works and only Task mode is affected suggests that the issue is related to the specific setup or configuration of the Task mode session.

Recommendation

Apply a workaround by modifying the socat command to retry the connection or adjusting the timing of the MITM proxy socket creation, as the root cause is likely related to the interaction between these components.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING