[BUG] API Error: Stream idle timeout - partial response received
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?
Description
When Claude generates a long response involving multiple large code files written back-to-back,
the stream times out mid-response with:
API Error: Stream idle timeout - partial response received
The partial response is shown but the remainder is lost.
Steps to reproduce
- Ask Claude to write several large files in one turn (e.g. a full HTML file + Python backend + Modal worker)
- Response cuts off partway through the last file
- Error banner appears: "Stream idle timeout - partial response received"
Expected behaviour
Either the full response completes, or the timeout resets on each streamed token
(not on wall-clock silence between API calls).
Environment
- Claude Code CLI (web session)
- Model: claude-sonnet-4-6
- Session type: Agent SDK session with hooks
Suggested fix
Increase or remove the per-stream idle timeout for agentic sessions where tool
calls and long codegen are expected, or chunk very long responses into separate
turns automatically.
What Should Happen?
No error
Error Messages/Logs
API Error: Stream idle timeout - partial response received
Steps to Reproduce
Use claude code web and send message to it, go to other thread, and return.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Web
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗