[BUG] ECONNRESET on every API call — macOS 26 Tahoe, Darwin 25.4.0, ARM64

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

Environment
OS: Darwin 25.4.0, RELEASE_ARM64_T6000, arm64 (macOS 26 Tahoe)
Claude Code versions tested: 2.1.121, 2.1.122, 2.1.123, 2.1.126 (all affected)
Machine: Apple ARM64 T6000
What is wrong
Every API call to api.anthropic.com/v1/messages fails with ECONNRESET after ~50ms. Claude Code retries 11 times then gives up. The session is completely non-functional.

What Should Happen?

Claude Code should connect to the API normally.

Error message
API error (attempt N/11): undefined Connection error.
Connection error details: code=ECONNRESET, The socket connection was closed unexpectedly.

Diagnosis
Claude Code uses Bun's Network.framework for HTTP on ARM macOS. Node.js reaches api.anthropic.com cleanly but Bun does not. Running the following Node.js test returns STATUS 401 as expected, confirming the network path is healthy. Claude Code fails with ECONNRESET on every attempt using the same network. Additionally, MCP proxy connections to mcp-proxy.anthropic.com via Bun do complete successfully (received Cloudflare 502), so the issue appears specific to api.anthropic.com rather than a blanket Bun networking failure.

What was ruled out

  • Corporate firewall or proxy: curl and openssl s_client both connect and complete TLS handshake successfully.
  • Auth and OAuth: token checks succeed every time.
  • TLS certificates: only one system CA cert present (Apple com.apple.systemdefault), no corporate CA interference.
  • Corrupted installation: full clean uninstall and reinstall to 2.1.126 shows identical failure.
  • Attempted fixes with no effect
  • CLAUDE_CODE_DISABLE_MTLS=1
  • Full clean uninstall including npm package, binary, ~/.claude/, ~/.claude.json, ~/.local/share/claude/, and Keychain credentials.
  • Reinstall to latest version 2.1.126.

Error Messages/Logs

From session with version 2.1.121:
2026-05-04T14:27:23.549Z [ERROR] API error (attempt 11/11): undefined Connection error.
2026-05-04T14:27:23.557Z [ERROR] Error in API request: Connection error.
2026-05-04T14:27:23.559Z [ERROR] Connection error details: code=ECONNRESET, message=The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch()
2026-05-04T14:27:23.560Z [ERROR] API error x-client-request-id=adcb0f2c-2946-4357-b8e3-a4e42651e1cb (give this to the API team for server-log lookup)

From session with version 2.1.126 (after clean reinstall):
2026-05-04T15:57:16.688Z [DEBUG] [API REQUEST] /v1/messages x-client-request-id=99a76400-6c9d-43dd-90a0-52b5bf2aa0c3 source=repl_main_thread
2026-05-04T15:57:16.738Z [ERROR] API error (attempt 11/11): undefined Connection error.
2026-05-04T15:57:16.740Z [ERROR] Error in API request: Connection error.
2026-05-04T15:57:16.741Z [ERROR] Connection error details: code=ECONNRESET, message=The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()
2026-05-04T15:57:16.742Z [ERROR] API error x-client-request-id=99a76400-6c9d-43dd-90a0-52b5bf2aa0c3 (give this to the API team for server-log lookup)
2026-05-04T15:57:16.743Z [ERROR] Error: Error: Connection error.
    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4056)
    at processTicksAndRejections (native:7:39)

Steps to Reproduce

  1. Install Claude Code on a Mac running macOS 26 Tahoe (Darwin 25.4.0) on ARM64 hardware
  2. Run claude and attempt any prompt
  3. Observe ECONNRESET errors on every API call, retrying up to 11 times before giving up
  4. Confirm network is healthy by running: curl -v https://api.anthropic.com/v1/models -H "x-api-key: dummy" (returns 401 as expected)
  5. Confirm Node.js reaches the API: node -e "const https = require('https'); https.get('https://api.anthropic.com/v1/models', {headers: {'x-api-key': 'dummy'}}, r => console.log('STATUS:', r.statusCode)).on('error', e => console.error('ERROR:', e.code, e.message));" (returns STATUS 401 as expected)
  6. Claude Code continues to fail while both curl and Node.js succeed from the same machine

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

Was working on 2.1.121 but with a previous macOS version

Claude Code Version

2.1.126

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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