Sustained ECONNRESET on streaming connections - Claude Code VS Code extension (Santiago, Chile / SCL region)
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 version 2.1.220 (Claude Code)
What's Wrong? Claude Code in the VS Code extension repeatedly fails with ECONNRESET after exhausting all retry attempts, even during short tasks. The connection is reported as stale before failing.
Environment
Client: Claude Code extension for VS Code
Model: claude-sonnet-4-6
Region: Santiago, Chile (SCL)
Date/time of occurrence: 2026-07-29T19:29:03Z
Steps to Reproduce
Open Claude Code in VS Code
Ask Claude Code to perform any task (even small ones)
Connection fails after retries with ECONNRESET
Relevant log
2026-07-29T19:29:03.717Z [DEBUG] Stale connection — disabling keep-alive for retry
2026-07-29T19:29:03.739Z [DEBUG] [API:timing] dispatching to firstParty model=claude-sonnet-4-6
2026-07-29T19:29:03.740Z [DEBUG] [API REQUEST] /v1/messages x-client-request-id=9a908b5e-b3d9-46f0-91ef-fae390030ab5 source=sdk
2026-07-29T19:29:03.761Z [ERROR] API error (attempt 11/11): undefined Connection error.
2026-07-29T19:29:03.761Z [ERROR] Error in API request: Connection error.
2026-07-29T19:29:03.761Z [ERROR] Connection error details: code=ECONNRESET, message=The socket connection was closed unexpectedly.
2026-07-29T19:29:03.761Z [ERROR] API error x-client-request-id=9a908b5e-b3d9-46f0-91ef-fae390030ab5 (give this to the API team for server-log lookup)
2026-07-29T19:29:03.761Z [ERROR] API connection_error after retries: Connection error.
x-client-request-id for server-log lookup 9a908b5e-b3d9-46f0-91ef-fae390030ab5
Troubleshooting already performed
Confirmed api.anthropic.com is reachable (TCP/TLS handshake succeeds)
No VPN/proxy in use
Verified Anthropic status page shows green at time of failure
Issue occurs consistently, not tied to a specific task size or complexity
Consistent with other reports suggesting Cloudflare edge nodes in the SCL (Santiago) region may be closing idle/streaming connections prematurely
What Should Happen?
Claude Code in the VS Code extension repeatedly fails with ECONNRESET after exhausting all retry attempts, even during short tasks. The connection is reported as stale before failing.
Error Messages/Logs
2026-07-29T19:29:03.717Z [DEBUG] Stale connection — disabling keep-alive for retry
2026-07-29T19:29:03.739Z [DEBUG] [API:timing] dispatching to firstParty model=claude-sonnet-4-6
2026-07-29T19:29:03.740Z [DEBUG] [API REQUEST] /v1/messages x-client-request-id=9a908b5e-b3d9-46f0-91ef-fae390030ab5 source=sdk
2026-07-29T19:29:03.761Z [ERROR] API error (attempt 11/11): undefined Connection error.
2026-07-29T19:29:03.761Z [ERROR] Error in API request: Connection error.
2026-07-29T19:29:03.761Z [ERROR] Connection error details: code=ECONNRESET, message=The socket connection was closed unexpectedly.
2026-07-29T19:29:03.761Z [ERROR] API error x-client-request-id=9a908b5e-b3d9-46f0-91ef-fae390030ab5 (give this to the API team for server-log lookup)
2026-07-29T19:29:03.761Z [ERROR] API connection_error after retries: Connection error.
Steps to Reproduce
Open Claude Code in VS Code
Ask Claude Code to perform any task (even small ones)
Connection fails after retries with ECONNRESET
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.220
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗