[BUG] Claude Code connections have a small timeout for CPU and a finite number of retries
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?
See how the connection has expired 5/10 times:
<img width="3810" height="1538" alt="Image" src="https://github.com/user-attachments/assets/84cdc084-e9e2-4c99-a66f-31a8961083da" />
It would likely fail when 10/10 would expire.
There shouldn't be such a timeout.
What Should Happen?
There should be no such timeout because the server can take a very long time on a CPU.
Error Messages/Logs
Steps to Reproduce
n/a
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Other
Operating System
Other Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
OS: FreeBSD 15 STABLE
---------------------------------------------------------------------------------------------------------
Claude times out after 10x 10 mins timeouts and fails the otherwise perfectly good communication with a CPU backed API endpoint that happened to be too slow:
<img width="3815" height="1507" alt="Image" src="https://github.com/user-attachments/assets/cba6e3d8-6af7-4947-8fa7-ca5e402b7b0b" />
Please fix timeouts. Make them configurable or remove them.
Here is the patch that fixes this problem:
${REINPLACE_CMD} \
-e 's/var EP5=60000;/var EP5=86400000;/' \
-e 's/API_TIMEOUT_MS||String(600000)/API_TIMEOUT_MS||String(86400000)/' \
-e 's/DEFAULT_TIMEOUT=600000;/DEFAULT_TIMEOUT=86400000;/' \
node_modules/@anthropic-ai/claude-code/cli.jsThis issue has 3 comments on GitHub. Read the full discussion on GitHub ↗