The fix is five lines in your CLAUDE.md, not a settings change Note: This is a personal workaround based on my own experience. Your mileage may vary. If you use Claude Code for anything longer than a short conversation, you have probably seen this: API Error: Stream idle timeout - partial response received Enter fullscreen mode Exit fullscreen mode It cuts off mid-response. Your work disappears. The retry often fails the same way. There is no recovery button. As of April 2026, it is one of the most reported bugs on the Claude Code GitHub repo, with multiple open issues going back months. The issue has been more common since the launch of Claude Opus 4.7 . Several GitHub issues filed since mid-April specifically name Opus 4.7 and the 1M context variant as triggers, and recent Claude Code changelogs show stream-handling improvements shipping. The bug also shows up in regular Claude chat sessions during long outputs, but Claude Code is where it hits hardest because of the heavy tool-call chains.…