API Connection Timeout Despite Healthy System Resources (125GB RAM Available)
Resolved 💬 7 comments Opened Jan 24, 2026 by jyongchul Closed Mar 1, 2026
API Connection Timeout Despite Healthy System Resources
Summary
Claude Code consistently fails with "Connection error" and "Request timed out" messages despite:
- 125GB available system memory
- Normal network connectivity (verified via curl)
- Low process counts (1 MCP process, 2 zombie processes)
- Anthropic API server responding to network tests
Environment
Claude Code Version: 2.1.19
Platform: WSL2 (Ubuntu on Windows)
Kernel: 6.6.87.2-microsoft-standard-WSL2
Node.js: v22.17.0
npm: 10.9.2
System Resources (At Time of Error)
$ free -h
total used free shared buff/cache available
Mem: 125Gi 1.4Gi 124Gi 3.5Mi 560Mi 124Gi
Swap: 32Gi 0B 32Gi
MCP Processes: 1 (normal)
Zombie Processes: 2 (normal)
Total Process Count: Well within normal limits
Error Message
● Bash(ls -la /mnt/c/82Mobile/82mobile-next/components/shop/ ...)
⎿ PreToolUse:Bash hook succeeded: Success
⎿ [output truncated]
⎿ PostToolUse:Bash hook succeeded: Success
⎿ API Error: Connection error.
✻ Worked for 4m 50s
❯ continue
⎿ UserPromptSubmit hook succeeded: Success
⎿ Request timed out. Check your internet connection and proxy settings
Retrying in 8 seconds… (attempt 6/10)
Network Diagnostics
$ curl -s -o /dev/null -w "%{http_code}" --max-time 5 https://api.anthropic.com
404
$ curl -s -o /dev/null -w "%{http_code}" --max-time 5 https://www.google.com
200
Network Status: ✅ Normal (404 from Anthropic API is expected without auth)
Reproduction Steps
- Work on a multi-step task in Claude Code for 4-5 minutes
- Execute Bash tool with hooks enabled (PreToolUse/PostToolUse)
- Observe "API Error: Connection error" followed by timeout
- Error persists through retries (attempt 6/10 shown)
Expected Behavior
API requests should succeed when:
- System has 124GB available memory
- Network connectivity is verified
- Process counts are normal
- No resource constraints present
Actual Behavior
API connection fails with timeout error, suggesting the issue is:
- Not related to system memory (125GB available)
- Not related to general network connectivity (curl tests pass)
- Possibly related to Claude API infrastructure or long-running sessions
Additional Context
- User increased system memory from previous config, no improvement
- Same error occurs across different working directories
- Error pattern suggests possible session-level connection degradation
- Related to issue #18762 (Plugin-MCP Configuration Mismatch) but distinct
Impact
High - Blocks productivity during multi-step tasks, forces session restarts
Workaround
Complete Claude Code restart (exit and relaunch) temporarily resolves the issue until it recurs.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗