[BUG] ECONNRESET on every API call — macOS 26.3.1 Tahoe, Intel x86_64
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?
Claude Code v2.1.83 fails with ECONNRESET on every API call, including /init, claude -p "hello", and background telemetry. The native binary's bundled Bun HTTP client cannot establish connections to api.anthropic.com, despite the network being fully functional. Standalone Bun (installed via npm), Node.js, and curl all connect to the API successfully from the same machine, confirming the issue is specific to Claude Code's internal HTTP client configuration — not the Bun runtime or the network.
What Should Happen?
Claude Code should connect to the Anthropic API and respond to prompts normally, the same way curl, Node.js, and standalone Bun do on this system.
Error Messages/Logs
❯ /init
⎿ API Error: Unable to connect to API (ECONNRESET)
Debug log (key lines):
[DEBUG] CA certs: useSystemCA=false, extraCertsPath=undefined
[ERROR] API error (attempt 1/11): undefined Connection error.
[ERROR] API error (attempt 2/11): undefined Connection error.
[ERROR] API error (attempt 3/11): undefined Connection error.
...
[ERROR] 1P event logging: 39 events failed to export (code=ECONNRESET, The socket connection was closed unexpectedly.)
[ERROR] 1P event logging: 33 events failed to export (code=ECONNRESET, The socket connection was closed unexpectedly.)
MCP servers also fail to authenticate during startup:
[ERROR] MCP server "claude.ai Google Calendar" Error: Streamable HTTP error: {"type":"error","error":{"type":"authentication_error","message":"MCP server requires authentication but no OAuth token is configured."}}
[ERROR] MCP server "claude.ai Gmail" Error: Streamable HTTP error: {"type":"error","error":{"type":"authentication_error","message":"MCP server requires authentication but no OAuth token is configured."}}
Steps to Reproduce
- Use an Intel Mac running macOS 26.3.1 (Tahoe), build 25D771280a
- Install Claude Code v2.1.83 (native binary)
- Launch claude and run /init — fails with ECONNRESET
- Try claude -p "hello" — hangs, then fails with ECONNRESET
Confirm network works with all other tools:
curl -v --ipv6 https://api.anthropic.com -m 10 → 404 (success)
curl -s https://api.anthropic.com/v1/messages -o /dev/null -w "%{http_code}" → 405 (success)
node -e "const https = require('https'); const req = https.request('https://api.anthropic.com/v1/messages', {method: 'POST'}, (res) => { console.log('Status:', res.statusCode); res.on('data', () => {}); }); req.on('error', (e) => console.log('Error:', e.message)); req.end();" → 401 (success)
bun -e "fetch('https://api.anthropic.com/v1/messages', {method: 'POST'}).then(r => console.log(r.status)).catch(e => console.log(e))" → 401 (success)
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
v2.1.83
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
macOS 26.3.1 (Tahoe), Intel x86_64, build 25D771280a
Claude Code v2.1.83, native binary (Mach-O 64-bit x86_64 with bundled Bun)
Node.js v22.18.0
No proxy, no VPN, no system extensions (systemextensionsctl list → 0 extensions)
Auth: Claude Pro account via OAuth (confirmed working via /status)
Binary at ~/.local/bin/claude is a self-contained Mach-O with embedded __BUN segment
npm-installed version also fails because it delegates to the same native binary
Attempted fixes that did not help:
CLAUDE_CODE_USE_SYSTEM_CA=1
NODE_EXTRA_CA_CERTS=/etc/ssl/cert.pem
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Full cache clear (rm -rf ~/.claude)
pkill -9 -f claude and clean restart
Related issues: #5674, #13657, #25229, #29591, #35768, #37077
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗