What this thread does
As of November 2026, diagnose the proxy/gateway and DNS path before increasing timeouts. Do first: distinguish Request timed out from No response from API in the error reference; first-byte and stream-idle deadlines are separate from the request timeout.
The problem
Claude Code keeps printing Request timed out with repeated retries and finally gives up. The GitHub issue was opened on 2025-06-29 by the reporter (Claude Code 1.0.35, Ubuntu 24.04, Max plan). It was closed on 2025-08-22.
The maintainer's answer
A Claude Code collaborator (bcherny) wrote on 2025-08-22 that it should feel better in later versions, with a few timeout UX improvements on the way, and gave three checks:
1. Make sure no gateway or proxy is in the way and slowing requests down. 2. Make sure your DNS resolves correctly and your internet connection is available. 3. Check that you can cURL the Anthropic API by hand.
If that does not help, he asked for a new issue. He did not name a fixed version.
What commenters found (not confirmed by Anthropic)
- DNS. One commenter on RedHat had an unreachable first nameserver in the resolver config and fixed it by listing only working resolvers (and keeping NetworkManager from overwriting the file). Several others said switching to public DNS helped; others said it did not. One commenter's fallback resolver was a filtering one and the timeouts went away after fixing the Pi-hole setup.
- Ad blockers. One commenter said AdGuard had started blocking an Anthropic telemetry subdomain and that allow-listing it fixed the timeouts. Treat this as a single report.
- VPN. One commenter fixed it by turning a VPN off; another said a VPN or Tor helped from one location. Both are single reports.
- WSL2 MTU. A commenter traced a connection-error variant on WSL2 to packet size and lowered the MTU on the network interface to 1200 with
sudo ip link set dev eth0 mtu 1200. Another commenter said this fixed their timeouts. It is a runtime change and not in any official doc linked here. - Timeout setting. A commenter quoted an Anthropic support message recommending
API_TIMEOUT_MSand said a 10-minute value worked. The official error reference keeps a 600000 ms (10 minute) request default. SettingAPI_TIMEOUT_MSto0disables that request timeout, but leaves first-byte and body-idle limits active; local non-streaming attempts retain a 300-second limit. If every request fails with0on a version before 2.1.305, update or use a positive value. ForNo response from API, the first-byte guidance describesCLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MSand gateway-specific behavior. Raising onlyAPI_TIMEOUT_MSis not a universal fix.
Outages are a different problem
Some commenters in late August 2025 posted 504 gateway timeouts while the status page looked green; the thread does not establish a single cause for those failures. Several commenters said nothing in this list helped them.
Takeaway
Treat this as a diagnosis order: proxy or gateway, DNS, a manual cURL, then (if you are on WSL2) the MTU, then the documented API_TIMEOUT_MS. The individual network fixes remain commenter reports.
Sources
- Claude Code issue 2728: historical retry symptoms and network workaround reports.
- Claude Code error reference: request/first-byte/idle limits and version-specific handling of a zero request timeout. Retry count defaults to 10; the watchdog can raise the transient-error budget, so
x/10describes the historical example.
Started from a post by @spinboson, packaged by the editor. Original post