[BUG] Claude Code CLI: Severe Connection Errors (65 errors/session) - macOS Sequoia 16.0

Resolved 💬 3 comments Opened Nov 16, 2025 by rgucsb Closed Nov 19, 2025

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 - Connection Error Issue Report

Executive Summary

Claude Code CLI (v2.0.42) experiences frequent "Connection error" failures on macOS Sequoia 16.0, occurring dozens of times per session and reducing productivity by ~50%. Debug logs show a pattern where streaming attempts fail with generic "Connection error" messages, even though:

  • Concurrent network tests show stable connectivity (0% packet loss, 24ms avg latency)
  • DNS resolution works correctly
  • HTTPS connection to api.anthropic.com succeeds
  • The error occurs inconsistently - some requests work while others fail immediately

The issue appears to be in Claude Code's API request handling logic rather than actual network connectivity problems.

---

Summary

Claude Code CLI repeatedly fails with "Unable to connect to API due to poor internet connection" error despite verified stable internet connectivity. This occurs many times per day and significantly impacts productivity (reducing productive time by approximately 50%).

Environment Details

  • Product: Claude Code CLI
  • Version: 2.0.42
  • Terminal: iTerm2
  • Operating System: macOS Sequoia 16.0
  • Network: Home network (no VPN, corporate proxy, or firewall)
  • Installation Method: sudo (system-level installation)
  • Claude Code Versions Tested: Multiple versions attempted (all exhibit same issue)

Issue Description

Error Message

retry
  ⎿  API Error: Connection error.
> retry
  ⎿  Interrupted · What should Claude do instead?
> continue
  ⎿  Unable to connect to API due to poor internet connection
     Retrying in 0 seconds… (attempt 5/10)

Frequency (Based on Last 48 Hours of Logs)

Analysis Period: November 14-15, 2025
Debug Logs Analyzed: 4 files, 2.9 MB total

Measured Error Rate (from single 2.6-hour session on Nov 15):

  • Total errors: 65 connection errors
  • Errors per hour: ~25 errors
  • Average error interval: 1 error every 2.4 minutes
  • Peak error clusters: Up to 11 errors within a single minute

Impact: Reduces productive time by approximately 50% due to constant interruptions and required manual retries

Duration

  • Issue started approximately 2 weeks ago
  • Has persisted across multiple Claude Code version updates
  • Previously worked without issues

Evidence of Stable Internet Connection

Concurrent Ping Test Results

While Claude Code displayed "poor internet connection" error, simultaneous ping test to google.com showed stable connectivity:

PING google.com (142.251.34.206): 56 data bytes
64 bytes from 142.251.34.206: icmp_seq=0 ttl=112 time=16.357 ms
64 bytes from 142.251.34.206: icmp_seq=1 ttl=112 time=24.326 ms
64 bytes from 142.251.34.206: icmp_seq=2 ttl=112 time=26.259 ms
64 bytes from 142.251.34.206: icmp_seq=3 ttl=112 time=24.628 ms
64 bytes from 142.251.34.206: icmp_seq=4 ttl=112 time=19.961 ms
64 bytes from 142.251.34.206: icmp_seq=5 ttl=112 time=17.167 ms
64 bytes from 142.251.34.206: icmp_seq=6 ttl=112 time=22.547 ms
64 bytes from 142.251.34.206: icmp_seq=7 ttl=112 time=26.968 ms
64 bytes from 142.251.34.206: icmp_seq=8 ttl=112 time=19.945 ms
64 bytes from 142.251.34.206: icmp_seq=9 ttl=112 time=18.570 ms
64 bytes from 142.251.34.206: icmp_seq=10 ttl=112 time=30.969 ms
64 bytes from 142.251.34.206: icmp_seq=11 ttl=112 time=20.879 ms
64 bytes from 142.251.34.206: icmp_seq=12 ttl=112 time=52.834 ms
64 bytes from 142.251.34.206: icmp_seq=13 ttl=112 time=51.656 ms
64 bytes from 142.251.34.206: icmp_seq=14 ttl=112 time=19.145 ms
64 bytes from 142.251.34.206: icmp_seq=15 ttl=112 time=28.270 ms
64 bytes from 142.251.34.206: icmp_seq=16 ttl=112 time=19.538 ms
64 bytes from 142.251.34.206: icmp_seq=17 ttl=112 time=25.121 ms
64 bytes from 142.251.34.206: icmp_seq=18 ttl=112 time=25.966 ms
64 bytes from 142.251.34.206: icmp_seq=19 ttl=112 time=29.089 ms
64 bytes from 142.251.34.206: icmp_seq=20 ttl=112 time=25.722 ms
64 bytes from 142.251.34.206: icmp_seq=21 ttl=112 time=22.007 ms
64 bytes from 142.251.34.206: icmp_seq=22 ttl=112 time=21.981 ms
64 bytes from 142.251.34.206: icmp_seq=23 ttl=112 time=30.021 ms
64 bytes from 142.251.34.206: icmp_seq=24 ttl=112 time=21.251 ms
64 bytes from 142.251.34.206: icmp_seq=25 ttl=112 time=22.801 ms
64 bytes from 142.251.34.206: icmp_seq=26 ttl=112 time=20.733 ms
64 bytes from 142.251.34.206: icmp_seq=27 ttl=112 time=20.929 ms
64 bytes from 142.251.34.206: icmp_seq=28 ttl=112 time=12.333 ms

Analysis: Average latency ~24ms with 0% packet loss - indicates stable, healthy internet connection.

Troubleshooting Steps Already Attempted

  1. ✅ Updated Claude Code to latest version
  2. ✅ Tried multiple different versions of Claude Code
  3. ✅ Verified internet connectivity with concurrent ping tests
  4. ✅ Confirmed issue persists across different sessions

Additional Diagnostic Information Needed

To help diagnose this issue, please advise on gathering:

  1. Claude Code debug/verbose logs
  2. Network trace during API call failures
  3. DNS resolution tests for api.anthropic.com
  4. Any local configuration files that might affect connectivity

Network Diagnostic Results

DNS Resolution Test

Server:		192.168.7.1
Address:	192.168.7.1#53

Non-authoritative answer:
Name:	api.anthropic.com
Address: 160.79.104.10

Status: ✅ DNS resolution working correctly

API Endpoint Connectivity Test

curl -I https://api.anthropic.com
HTTP/2 404
date: Sat, 15 Nov 2025 23:42:10 GMT
cf-ray: 99f29a8529b17530-SEA
cf-cache-status: DYNAMIC
x-robots-tag: none
server: cloudflare

Status: ✅ HTTPS connection to api.anthropic.com successful (404 expected for base endpoint)

Claude Code Configuration Files Found

~/.claude.json (45KB)
~/.claude.json.backup (45KB)
~/.claude/debug/ (48 files)
~/.claude/history.jsonl (2.1MB)
~/.claude/settings.json
~/.claude/settings.local.json

Note: Debug logs directory contains 48 files - may contain error details

Technical Error Analysis from Debug Logs

Primary Error Pattern

The debug logs reveal a consistent pattern of streaming errors followed by failed non-streaming fallbacks:

[ERROR] Error streaming, falling back to non-streaming mode: Connection error.
[ERROR] Error in non-streaming fallback: Connection error.
Error: Error: Connection error.
    at S_.makeRequest (file:///.../cli.js:715:4463)

Error Frequency

  • 65 connection errors documented in a single 2.6-hour work session (Nov 15, 21:01-23:39)
  • ~25 errors per hour (1 error every 2.4 minutes on average)
  • Errors occur during every API interaction attempt
  • Peak clusters show up to 11 errors within a single minute (21:03)
  • Sometimes the stream starts successfully (Stream started - received first chunk) but then immediately fails

Key Observations

  1. Initial Success Then Failure: Many requests show Stream started - received first chunk followed immediately by Connection error
  2. No Specific Error Details: The error message is generic "Connection error" with no additional context (timeout, DNS, TLS, etc.)
  3. Inconsistent Behavior: Some requests complete successfully while others fail, even in rapid succession
  4. No Client-Side Network Issues: Concurrent ping tests show stable connectivity with 0% packet loss and ~24ms average latency

Error Location in Code

The error originates from:

  • S_.makeRequest function at cli.js:715:4463
  • During streaming attempts and non-streaming fallback attempts
  • Affects all tool operations (Bash, Edit, Read, etc.)

Questions for Support

  1. Are there known issues with Claude Code API connectivity on macOS Sequoia 16.0?
  2. What specific error condition causes the generic "Connection error" message?
  3. Are there timeout values that might be too aggressive for certain network conditions?
  4. Is there verbose logging that could reveal the underlying cause (DNS, TLS handshake, socket timeout, etc.)?
  5. Why does the stream sometimes start successfully but then immediately fail with a connection error?
  6. Are there rate limits or throttling that could be causing these intermittent failures?

Impact Statement

This issue is a critical blocker that:

  • Reduces productive coding time by ~50%
  • Requires constant manual retries and intervention
  • Makes Claude Code unreliable for professional development work
  • Disrupts workflow and concentration

Request

Urgent assistance needed to resolve this connectivity issue. The problem appears to be with Claude Code's connection logic rather than actual network connectivity, as evidenced by stable concurrent ping tests.

---

Submitted by: Rahul
Date: November 15, 2025
Priority: High/Urgent

What Should Happen?

I want the connections erros to go away as this is a major drag on my productivity.

Error Messages/Logs

# Claude Code Error Frequency Analysis - Last 48 Hours

## Summary
Analysis of debug logs from November 14-15, 2025 reveals severe connection reliability issues.

## Data Sources
- **Time Period**: November 14-15, 2025 (48 hours)
- **Debug Log Files**: 4 files totaling 2.9 MB
  - 76e960d5-6f35-41c5-a99d-8a096e24c57b.txt (243 KB) - Nov 15 15:40
  - 4e4df196-a6ec-4884-a1c1-208b89389b5c.txt (785 KB) - Nov 15 15:29
  - 5897b26b-b584-4a92-a36f-66cbadfc2634.txt (899 KB) - Nov 15 12:58
  - 2466da0c-c9eb-4134-9a8b-09558c1dfde2.txt (1.1 MB) - Nov 14 14:50

## Detailed Analysis (Nov 15 Evening Session)

### Time Range
- Start: 21:01:30
- End: 23:39:11
- Duration: 2 hours 38 minutes (158 minutes)

### Error Count
- **Total Errors**: 65 connection errors
- **Error Rate**: ~25 errors per hour
- **Average Interval**: 1 error every 2.4 minutes
- **Success Rate**: Significant portion of API calls fail

### Peak Error Periods
Errors clustered within 1-minute windows:
- **21:02**: 5 errors
- **21:03**: 11 errors (worst cluster - essentially unusable)
- **21:04**: 4 errors
- **21:20**: 4 errors
- **21:25**: 4 errors
- **21:27**: 4 errors
- **21:28**: 3 errors
- **21:30**: 4 errors
- **21:35**: 4 errors

### Error Pattern
1. Most errors: "Error streaming, falling back to non-streaming mode: Connection error"
2. Some errors: "Error in non-streaming fallback: Connection error" (complete failure)
3. Occasionally: Stream starts successfully then immediately fails

## Productivity Impact Calculation

### Time Lost Per Error
Assuming each error requires:
- Recognition: 2-3 seconds
- Decision to retry: 1-2 seconds
- Manual retry action: 2-3 seconds
- Re-establishing context: 5-10 seconds
- **Total per error**: ~10-15 seconds minimum

### Total Time Lost (2.6 hour session)
- 65 errors × 15 seconds = 975 seconds = 16.25 minutes
- **Direct time loss**: ~10% of session time
- **Context switching overhead**: Additional 20-30% productivity loss
- **Frustration and workflow disruption**: Immeasurable but significant

### Estimated Overall Productivity Impact
- Direct time loss: 10-15%
- Context switching: 20-30%
- Uncertainty/hesitation: 10-15%
- **Total estimated impact**: 40-60% productivity reduction

## Comparison to Normal Operation
In a properly functioning system:
- Expected error rate: 0-1 errors per session
- Observed error rate: 65 errors per 2.6-hour session
- **Error rate is 65-650x higher than expected**

## Conclusion
The error frequency (1 error every 2.4 minutes) makes Claude Code essentially **unreliable for professional development work**. The clustering of errors (up to 11 in a single minute) suggests systemic issues rather than transient network problems.

Steps to Reproduce

  1. Launch Claude Code CLI in iTerm2 terminal on macOS Sequoia 16.0
  2. Start any coding task (e.g., "help me create a new React component")
  3. Observe that API requests frequently fail with "Connection error"
  4. Note: Errors occur intermittently - approximately 1 error every 2-4 minutes
  5. Run concurrent ping test (ping google.com) to verify network is stable
  6. Continue using Claude Code for 30+ minutes
  7. Check debug logs at ~/.claude/debug/latest to see accumulated errors

REPRODUCIBILITY: 100% - Issue occurs in every session, multiple times per session

FREQUENCY: ~25 errors per hour during active use

NOTE: Issue is NOT reproducible by:

  • Specific commands or prompts
  • Specific project types
  • Time of day
  • Network conditions (occurs even with perfect connectivity)

The errors appear random/intermittent but are consistent in their frequency.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.42 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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