[BUG] API Error (Connection error.)
Environment
- Platform (select one):
- [ X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: latest
- Operating System: Windows 11
- Terminal: WARP
Bug Description
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
Steps to Reproduce
- Start Claude Code
- Craft a brilliant prompt
- Watch your tokens get wasted on a broken api
Expected Behavior
I expect that when I pay for a service, that the service doesn't fail unexpectedly so frequently that it becomes expected.
Actual Behavior
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ TypeError (fetch failed)
Results in hour long hangs on prompts, slows development to a crawl, and sometimes results in funky results.
Additional Context
The only context needed here is that this has been going on for far too long now, and we're reported it daily here, but it doesn't appear from this end that any progress is being made, or communicated. Simply instead, every day we deal with it again and again, and these bug reports continue to get closed as if it's resolved.
ITS NOT RESOLVED. STOP CLOSING THESE REPORTS AS IF IT IS
47 Comments
I'm a user but I fixed a similar issue with the authorization token by typing /login and resigning in.
I just tried this but that didn't resolve the issue. This issue only appears when I have colima running.
I ran a tcpdump and I can see that a TLS session is getting negotiated and shortly after I get a TCP RST.
<details>
<img width="1728" height="1079" alt="Image" src="https://github.com/user-attachments/assets/06ef1af8-23e0-4220-a506-e4ddf63d292b" />
</details>
It won't fix it, this is a systemic problem that's related to Anthropic's API instability. I'm about as fed up as I can get with it. It's entirely too disruptive to be using for production coding. This has gotten obscene:
I see by the status page has been updated as if Anthropic has solved the problems. Nope!
I have the same thing happening to me, however it doesn't happen on my Linux server running on Oracle Cloud, nor does it happen on my Windows operating system. It only happens on my Mac OS. My Mac OS and my Windows operating system are on the same network. I've been hammering away at this for about 12 hours today and I can't figure out how to fix it or get around it. The most confusing thing is that it only happens on my Mac OS.
[omayhemo] - are you still having this issue to this date or did you figure out a way to resolve it? What's going on?
I don't know if it's helpful to anyone here, but I stumbled across this comment, which _finally_ fixed the issue for me.
I'm getting nothing but this and can't re-login now, I get a connection reset on the callback. Note there's no other network issues I'm having, I work on this network all day, it's pretty stable.
edit: I busted out Wireshark, adding a screencap of the capture. All resets seem to be similar, basically syn -> syn ack -> ack -> hello -> reset. If you want the actual pcap, please reach out, happy to provide.
another edit: I haven't been this deep in TCP in a minute but the client hello is regularly split into two frames, in this screenshot frames 1560 & 1561. And it seems the first frame gets lost, not ack'd, and then reset comes before the retransmission.
one more edit after an hour of not being able to stop looking: I believe we have an MTU issue, somewhere along this path (I dare say Anthropic's server side) doesn't like the 1500 byte MTU. I lowered it to 1400, so the largest "client hello" frame is 1414 (down from 1514 bytes), and all is happy then, no connecting resets. This is the second Wireshark screenshot.
✅ So for anyone else here, try
sudo ifconfig en0 mtu 1400, assuming your interface isen0and you're on MacOS. On Linux check theipcommand, something likeip link set dev en0 mtu 1400.<img width="404" height="572" alt="Image" src="https://github.com/user-attachments/assets/4f63d904-745b-40e8-8c3f-b51e3043de4e" />
<img width="1291" height="361" alt="Image" src="https://github.com/user-attachments/assets/cf5f1c66-fd86-43bd-a495-c4a84061eda4" />
<img width="1286" height="296" alt="Image" src="https://github.com/user-attachments/assets/aa09d15f-14e5-4c08-84a8-bb3e0930c7af" />
I’m going to try this shortly and report back. Thanks for sharing. I’ll also look on my Linux and windows to compare and see what is going on. I’ll be honest I don’t have my hopes up though. But will let you all know soon. By the way is there a way to open a ticket with Anthropic? I’ve scoured the website and can only find a useless chat bot. I’m paying 200$ a month for a company that makes it so hard to get a hold of. Please anyone let me know, if this doesn’t work, we need to escalate this for some users
My friend in Dubai sees the errors too, he says transient for him, he is on a Mac too. For me they are mild at first but over time get unbearable and do not allow a task to complete and kills Claude code eventually. I’m in San Diego.
UPDATE:
System | Interface | MTU | API Errors?
Mac | en0 | 1500 | YES (ECONNRESET)
Linux9 | enp0s6 | 9000 | NO
Win11 | Ethernet | 1500 | NO
---
ok so i made the change on macOS to 1400 and right off the bat I get the API errors again. this fix is not working for me. note that I do not get these errors on Oracle LInux 9 (running on oracle cloud) which has a whopping 9000 MTU setting nor do i get it on win 11 which is at 1500. something is up with anthropic. i have another mac i can turn on maybe over the weekend, i'll look to set it up there and see if i get the same api errors on a different mac. NOTE: Mac and Win are on the same network, the network is stable, no issues with it. ofcourse linux is on a different network being it is on oracle cloud
⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 1 seconds… (attempt 2/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 2 seconds… (attempt 3/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 5 seconds… (attempt 4/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 8 seconds… (attempt 5/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 18 seconds… (attempt 6/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 34 seconds… (attempt 7/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)⎿ API Error (Connection error.) · Retrying in 40 seconds… (attempt 8/10)
⎿ Error (The socket connection was closed unexpectedly. For more information, pass
verbose: truein the second argument to fetch()) (ECONNRESET)UPDATE: I opened a formal ticket, I'll report back on what support says.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
No DO NOT close. You need to fix this!
Here is how you contact support, but so far they are like bots, look at the thread below. I'll let you know what happens when they reply again. Send an email to: support@anthropic.com
---------------------------------------------------------------------
MY FIRST EMAIL TO SUPPORT
Hello Anthropic Support,
Claude Code CLI on macOS has been completely unusable for 2+ days due to persistent ECONNRESET errors. The issue is macOS-specific - identical setups work on Linux/Windows. Extensive troubleshooting including the community MTU workaround has not resolved the problem.
Claude Code API Connection Issues - macOS Specific (2+ Days of Daily Impact)
Summary
Experiencing persistent ECONNRESET socket connection errors with Claude Code CLI on macOS that prevent normal usage. Issue has been ongoing since August 12, 2025 (2+ days of continuous daily impact). Problem appears macOS-specific as the same setup works correctly on Linux and Windows systems.
Environment Details
Issue Duration: August 12, 2025 to present (2+ days)
Frequency: Daily occurrence preventing normal Claude Code usage
Severity: Complete inability to use Claude Code CLI for development workflows
User Impact: Forced to use alternative systems (Linux server) for Claude Code functionality
System: macOS (Apple Silicon M1 Pro)
Claude Code Version: 1.0.77
Network: Standard home broadband, MTU 1500 → 1400 (recently adjusted)
Error Pattern
API Error (Connection error.) · Retrying in 1 seconds… (attempt 1/10)
Error (The socket connection was closed unexpectedly.) (ECONNRESET)
Retry pattern: 1s, 1s, 2s, 5s, 9s, 19s, 39s... with consistent ECONNRESET failures.
Cross-Platform Comparison
macOS: Persistent ECONNRESET errors, Claude Code unusable
Linux Server (Oracle Cloud): No issues, MTU 9000 (jumbo frames)
Windows: No reported issues, MTU 1500
Comprehensive Troubleshooting Attempted
Network-Level Diagnostics
DNS Resolution: Cache clearing (dscacheutil -flushcache), mDNSResponder restart
VPN Analysis: Multiple utun interfaces present but no active VPN connections
Network Interface: Full interface resets (ifconfig en0 down/up)
Routing: Route cache clearing, gateway verification
MTU Configuration: Reduced from 1500 to 1400 based on community reports (No improvement observed)
Firewall: macOS Application Firewall confirmed disabled
OS Reboots: Numerous reboots with no resolutions
Claude Code CLI Reinstalls: Full removal and reinstall did not fix issue
TCP/Socket Optimization
TCP Keepalive: Configured always_keepalive=1, keepidle=60s, keepintvl=10s
Socket Buffers: Increased sendspace/recvspace to 131072 bytes
Connection Limits: Raised kern.ipc.somaxconn to 256
Window Scaling: Optimized net.inet.tcp.win_scale_factor
Application-Level Testing
Authentication: Re-authentication, API key verification
Claude Code Versions: Tested with v1.0.77, v1.0.80, and v1.0.81 (latest)
Direct API Testing: curl commands to api.anthropic.com endpoints
Process Isolation: Verified no conflicting Claude processes
Configuration: Checked ~/.claude/ settings and permissions
System-Level Actions
macOS Restarts: Multiple system reboots attempted
Network Location: Tested different network configurations
Safe Mode: Attempted minimal driver loading
Process Monitoring: Checked for network security software interference
Alternative Network Testing
Different Networks: Tested on multiple network connections
Mobile Hotspot: Confirmed issue persists across network providers
Corporate Network: Ruled out enterprise firewall interference
Community Reports
Multiple GitHub issues and forum posts describe identical symptoms:
MTU Workaround: One user reported success reducing MTU from 1500→1400, but this solution did not resolve our issue
macOS Specificity: Reports consistently mention macOS-only occurrence but others mention it also on Windows OS
Enterprise Networks: Some reports link to corporate network infrastructure
Wireshark Evidence: Packet captures show TLS handshake fragmentation patterns
Timeline: Issues reported intensifying since August 2024 across multiple versions
Technical Analysis
The ECONNRESET errors occur during TLS handshake with a specific pattern:
Wireshark Analysis: TLS Client Hello packets fragmented across multiple TCP frames
Fragmentation Issue: Packets >1460 bytes split due to standard Ethernet MTU 1500
Network Path Problem: Intermediate infrastructure fails to reassemble fragments properly
Platform Specificity: Issue affects macOS clients specifically, suggesting OS-level TCP handling differences
Retry Pattern: Exponential backoff (1s, 1s, 2s, 5s, 9s, 19s, 39s) consistently fails
Additional Context
Environment Details Addendum
Node.js: v22.17.0 (via NVM)
Request
Please investigate macOS-specific connection handling for Claude Code CLI
The issue appears to be macOS platform-specific as other operating systems work correctly with identical network configurations.
---------------------------------------------------------------------
THEIR FIRST REPLY TO ME:
_From: Sabrina from Anthropic:_
Hi there,
Thanks for reaching out and sincere apologies for the delay here - we're working hard to restore our typical response times. Our systems are detecting your inquiry is regarding error messages or platform performance issues.
Understanding Claude Error Messages
We appreciate you taking the time to report these issues. Error messages and platform disruptions can be frustrating, and we want to help you understand what's happening and how to resolve common issues.
Common Service Interruption Messages
If you're seeing error messages like "Claude will return soon" or "Due to unexpected capacity constraints, Claude is unable to respond to your message", these indicate temporary service disruptions on our end. These messages appear when our systems are experiencing either planned maintenance, unexpected technical issues, or high demand that temporarily exceeds our capacity.
These disruptions typically affect multiple users simultaneously and are not caused by anything you've done. Our Engineering team monitors these issues 24/7 and works quickly to restore service - most issues are resolved within minutes to a few hours. There's nothing you need to do except wait while we work on the fix, though you're welcome to try again periodically.
Troubleshooting Steps
If your error message isn't related to a reported incident, please try these troubleshooting steps first:
Clear your browser's cache and cookies
Confirm you're not using a VPN
Toggle off all browser extensions
Confirm you're using the latest version of your browser (and update if needed)
Restart your browser completely
These steps resolve many common issues and can help restore normal functionality.
Our Commitment to Reliability
We sincerely apologize for any frustration and inconvenience these problems have caused you when using Claude. Our engineers are committed to improving our platform's reliability and are actively working to implement additional measures to prevent similar disruptions in the future. We're constantly investing in our infrastructure to support growing demand and provide you with the best possible experience.
You can always check status.anthropic.com for real-time information about service interruptions. For additional resources, visit our help center at support.anthropic.com.
Note that further replies to this ticket may not be monitored. If your request is not regarding error messages or platform performance, or you need additional support, please visit our help page at support.anthropic.com.
Best,
Anthropic Support
---------------------------------------------------------------------
MY RESPONSE TO SABRINA
_I UPDATED THE SUBJECT LINE TO THIS: URGENT: $200/month Customer - Claude Code CLI Platform Bug Ignored by Generic Response_
Sabrina,
Your response completely misses the technical issue I reported. This is not about browser errors or web platform disruptions.
What I Actually Reported:
Claude Code CLI (command-line tool) ECONNRESET socket connection errors on macOS
Platform-specific bug affecting the $200/month Claude Code CLI product
3+ days of complete inability to use paid CLI service
Extensive technical troubleshooting with packet capture analysis
Cross-platform testing showing Linux/Windows work, macOS fails
What You Responded With:
Generic browser troubleshooting for web platform issues
VPN/cache clearing suggestions for claude.ai website problems
Template response that doesn't mention Claude Code CLI once
The Problem: I'm paying $200/month specifically for Claude Code CLI access, and your engineering team has a platform compatibility bug that makes the CLI completely unusable on macOS. This is not a web browser issue.
What I Need:
Escalation to Claude Code CLI engineering team (not web platform support)
Technical investigation of macOS-specific ECONNRESET connection handling
Engineering response acknowledging this as a CLI platform bug
Timeline for resolution of this paid service disruption
Evidence Provided:
Complete technical troubleshooting documentation
Cross-platform version comparison (macOS v1.0.81 fails, Linux v1.0.80 works)
Wireshark packet captures showing TLS handshake failures
MTU testing and network diagnostics
This is a CLI product engineering issue, not a website support request. Please route this to the appropriate technical team immediately. I'm also not the only person online reporting this problem, do an online search and see for yourself.
As a $200/month customer, I expect engineering attention for platform-specific product bugs, not generic web browser troubleshooting templates.
Thanks to @ryanmr82, it worked for me when I changed MTU from 1500 to 1400.
I wish it worked for me, I still got errors when changing to 1400, it didn’t helps me. Are you on macOS?
I've got a user who's experiencing this issue. Running on M3 Pro, macOS 15.5.1. Attempted clearing auth tokens and signing back in to no avail. Updated node, happening in iTerm, terminal, and in IntelliJ's native terminal.
We're currently using a VPN with TLS inspection, but other users, including myself, are using Claude Code and we only have the one user affected, everyone else is working as expected. I've tested on several test devices.
Would be great to get an update on this.
I’m paying 200$ a month and being ignored by Claude support, wish I could help. Everyone should email their support and report this. Works fine on another Mac book and I can’t figure out why it’s only this one specific MacBook
I have the same issue. Very frustrating!
I have the same exact issue, weird !!!
Just got this issue:
API Error (Connection error.) · Retrying in 18 seconds… (attempt 6/10)
⎿ TypeError (fetch failed)
same here. looks like a global error for many users
API Error (Connection error.) · Retrying in 4 seconds…
bug-report function in claudeCode doesn't work either btw
Same for me!
Investigating - We are currently investigating this issue.
Sep 22, 2025 - 20:58 UTC
That's what i got when trying to login again, I think its a global issue :
Claude will return soon
Claude.ai is currently experiencing a temporary service disruption. We’re working on it, please check back soon.
Mine got fixed
I have the same problem using the vscode extension, but using the CLI it worked when logging in again.
same here...
With the new version I had no trouble anymore. But I moved my development environment to Ubuntu Desktop. Also no issues there.
hi team, very curious... I'm in Spain and I'm using one of the most important operator of internet, Movistar. If I use my internet conection from home, it's not working... if I use my phone, sharing internet to my desktop Mac, no problem...
Hello neighbor, I do the same :-)
What you mean with "use my internet connection from home"?
hi @UweBear, I refer to use my home router :)
In my case the problem is with Movistar (my ISP)
Same here I can't connect to API with Cloudflare Warp turned ON. It NEVER happened before.
BTW: I have 300 Mbps Download & Upload, so this can't be a poor Network issue.
If I turn CF Warp OFF -> Claude Code works.
Claude Desktop is Not affected.
Note: I know that Cloudflare Warp has nothing to do with Warp from original post ! I also will fill a bug report I guess as I can't work with Caldue code anymore ( as CF Warp must be ON )
Same but only from my office. My Movistar connection at home works most of the time (but not always…). Further investigation suggests it is an issue with the access point (we are on a mesh-like network) that my computer normally connects to. If I connect via a hotspot on my phone, even though it is on the same wifi network, the connection works fine.
Same here!
I discovered the problem. It's actually hallucinating that it has an internet connection problem. When it got stuck in one of these "internet connection problem" loops, I interrupted it and then I asked it: "why do you have an internet connection problem? I don't have an internet connection problem". It then started explaining why it didn't have a problem and continued with the original prompt processing and stayed fixed for quite some time.
I don't think it is a hallucination because in order to hallucinate it needs to actually connect with the LLM. Also, when I change wifi networks it influences the behavior. On one network the behavior is present but on another it is not (consistently) so I don't think it's a hallucination.
I was wrong about the hallucination theory.
Someone showed me the answer. I had to switch my DNS to something other than the router default (e.g. 8.8.8.8) and then disable IPV6. After that, the problem disappeared.
________________________________
From: Ted Stresen-Reuter @.*>
Sent: Thursday, December 11, 2025 6:03 PM
To: anthropics/claude-code @.*>
Cc: jss030563 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Connection error.) (Issue #4297)
[https://avatars.githubusercontent.com/u/28703641?s=20&v=4]tedsecretsource left a comment (anthropics/claude-code#4297)<https://github.com/anthropics/claude-code/issues/4297#issuecomment-3641167357>
I don't think it is a hallucination because in order to hallucinate it needs to actually connect with the LLM. Also, when I change wifi networks it influences the behavior. On one network the behavior is present but on another it is not (consistently) so I don't think it's a hallucination.
—
Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/4297#issuecomment-3641167357>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHAQADBCL5DNMYSLP5BQHR34BE6NLAVCNFSM6AAAAACCI2DVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNBRGE3DOMZVG4>.
You are receiving this because you commented.Message ID: @.***>
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
It is still happening. It is less frequent but does come up from time to time. Also, although I can't state the exact behavior / relationship, it seems like it might be related to IPv6 being available or unavailable.
Having the same issue on macOS on CLI and desktop apps. Claude just doesn't respect the system trusted root CAs in Keychain nor does setting the node CA file variable
Meet the same issue here. I'm on MacOS with CC CLI.
same issue, Claude Code v2.1.81 macOS, Claude desktop app
Claude 1.1.7714 (3bd6f6)suddenly stop working, and keep me waiting forever, no errordouble-check wifi, internet connection, pkill -9 claude, reopen Terminal/Desktop app,..., ping google, disconnect/reconnect wifi, all good, listen some music, calm down...
check claude in Terminal app with cmd
claude ping:thinking of rebooting macbook to get it back working, hopefully
Hello, does rebooting works?
bad news, it's the only way I can make it work again, kind of taking a break from coding...
found a fix, it could be a connection issue, try to use another network, set up a private vpn somewhere (a wireguard vps), use it for claude cli
Same issue here on Claude Code v2.1.121 macOS, no Claude desktop app. After a while and a few tries i found the fix that worked for me - had to remove "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1" from my ~/.claude/settings.json to make it work again.
I've been hitting this repeatedly for the last 12 hours on Claude Code 2.1.195, no desktop app, and on Mac OS 26.3.
Edit: running
/compactdoes not resolve it.Edit 2: ~~turning off "Limit IP address tracking" in the MacOS network settings appears to resolve it.~~
Edit 3: still happening