Frequent 504 Gateway Timeout errors from api.anthropic.com
Description
Experiencing frequent and random 504 Gateway Timeout errors when using Claude Code, which significantly impacts productivity.
Error Details
API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 16 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 34 seconds… (attempt 8/10)
I'm now having difficulty recovering my session, even after the agent responded:
Frequency
These errors occur randomly during normal usage, often requiring multiple retry attempts before succeeding.
Impact
- Interrupts workflow
- Causes delays in development
- Sometimes requires 8+ retry attempts
Environment
- Claude Code CLI
- Platform: macOS (Darwin 23.5.0)
- Date observed: 2025-08-29
Expected Behavior
API calls should complete successfully without frequent gateway timeouts.
Additional Context
The retry mechanism does eventually succeed in most cases, but the frequency of these errors suggests there may be an infrastructure or rate limiting issue that needs investigation.
Workaround:
I was able to recover my session task by asking the agent to break out the output file into seperate smaller files.
I got it to write one file, but now it's stuck again:
Here's a screenshot of my current context usage for whomever at anthropic works on debugging this issue:
Same here. It starts out working ok but as context length grows I run into these errors. I think #6781 is the same issue.
Found 1 possible duplicate issue:
- https://github.com/anthropics/claude-code/issues/6781
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback
For more context:
same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback
https://status.anthropic.com/ not showing any outages.
same here
Full Context
Same here
So, here is what happened, after the error I hit:
Not sure if this has anything to do with it, but they just updated their status page:
I think it's resolved and working fine for me now.
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.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.