[BUG] Opus 4.8 (1M) stream hangs after first chunk since 2.1.154; 2.1.153 is last known good
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?
When using Opus 4.8 (1M context), Claude Code frequently hangs in the thinking/streaming state with no further output.
The strongest signal is a precise version boundary and long-term regression tracking:
- Last known-good version: 2.1.153
- First known-bad version: 2.1.154
- Latest tested bad version: 2.1.197
- I have been tracking Claude Code releases since 2.1.154. I did not test every single release, but I tested many versions across the 2.1.154 -> 2.1.197 range.
- Every tested version reproduced the same Opus 4.8 hang/misbehavior.
- Each time I confirmed the issue still existed, I rolled back to 2.1.153, which remains stable on this same machine.
Observed symptoms:
- The stream enters a long "thinking" state with no output.
- The API stream is established and TTFB is normal, but after the first chunk the stream stops entirely.
- It only recovers via the idle watchdog after several minutes.
- One occurrence produced a semantically unrelated response:
- Input: "Can you update pricing.json?"
- Response: "Understood, I'll write it to memory ✨"
- I interrupted immediately. Transcript inspection confirmed no tool_use was sent and no file was modified.
This appears specific to Opus 4.8 / 1M behavior on this machine. On the same machine, Opus 4.7 works normally.
What Should Happen?
Claude Code should continue streaming usable output after the first response chunk, or fail fast with a clear recoverable error if the stream stalls.
The assistant response should correspond to the latest user prompt. It should never silently answer a stale/nonexistent context or produce unrelated content after long thinking.
A regression introduced after 2.1.153 should not require users to pin/rollback indefinitely in order to use Opus reliably.
Error Messages/Logs
Captured with:
claude --debug api --debug-file ~/claude-opus-debug.log
Findings:
- TTFB is normal: first byte arrives within ~1.3-1.8s.
- Hang pattern: after receiving the first chunk, no further stream events arrive for an extended period.
- Recovery only happens through the idle watchdog after several minutes.
- This suggests the connection is established successfully; the failure occurs after stream start / after the first chunk.
No sensitive request IDs or API keys are included here, but I can provide sanitized debug excerpts if needed.
Related in-product feedback report with session details:
Feedback ID: ce515f85-8f15-4669-abce-3471ad252167
Steps to Reproduce
- Use Claude Code on the affected Mac with Opus 4.8 / 1M context.
- Run a normal coding prompt or file-editing prompt. The issue is intermittent but recurring.
- Observe that the stream enters "thinking" and then hangs with no useful output.
- Capture debug logs with
claude --debug api --debug-file ~/claude-opus-debug.log. - In the debug log, observe normal first-byte timing followed by no further stream events until the idle watchdog recovers/aborts.
- Downgrade/pin Claude Code to 2.1.153 on the same machine and repeat similar work: Opus 4.8-related hang/misbehavior does not reproduce there.
- Upgrade again to later versions in the 2.1.154 -> 2.1.197 range: the issue returns.
Reproduction is not 100% deterministic per prompt, but it has reproduced repeatedly for over a month across many tested Claude Code versions after 2.1.153.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.153
Claude Code Version
2.1.197 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Environment / comparison matrix:
| Machine | Chip | Tailscale | Opus 4.8 |
|---|---|---|---|
| Affected Mac | Apple M4 Max (Mac16,6, 64GB, arm64) | Installed | Hangs / misbehaves |
| Other Mac | M1 Pro | Not installed | Normal |
| Windows machine | - | Installed | Normal |
Factors ruled out or reduced in likelihood:
- Network / DNS / proxy: checked, no anomaly found.
- VPN / Tailscale: another working machine also uses Tailscale.
- macOS version: reproduced before and after OS upgrade.
- Node.js version: tested and ruled out.
- Terminal emulator: reproduced across terminals, not limited to one terminal app.
- Statusline script: measured at ~39ms, not a plausible cause.
- Local Claude cache/config: deleted/reinstalled
~/.claudeand.claude.json; issue persisted. - Account routing: same Anthropic account works fine on other machines.
Model comparison:
- Same affected machine + Opus 4.7: works normally.
- Same affected machine + Opus 4.8 / 1M: hangs or misbehaves.
Release-note correlation around 2.1.154:
- 2.1.154 changed the lean system prompt default for models except Haiku, Sonnet, and Opus 4.7 and earlier, which means Opus 4.8 is in the newly affected category.
- 2.1.154 also mentioned a fix for premature out-of-context behavior on some 1M-context models.
- Opus 4.8 defaulting to high effort may also be relevant, although my local global setting is
effortLevel: "low".
Possibly related issues:
- #46745 - stream dies after first chunk / silent stalls
- #66095 - Opus 4.8 stream byte stalls / idle timeout
- #69061 - Opus 4.8 responds from nonexistent context after long thinking
- #68352 - Opus 4.8 (1M) recurring unusable assistant outputs
- #67606 - Opus 4.8 confabulates user messages / stale-context-like behavior
Requested investigation:
- Check for a regression introduced in 2.1.154 that still affects 2.1.197.
- Investigate Opus 4.8 / 1M stream handling after the first chunk.
- Investigate whether the lean system prompt / 1M-context behavior change in 2.1.154 can trigger stale-context or stream-hang behavior.
- Investigate whether M4-series Apple Silicon exposes a low-level client/runtime compatibility issue.
- Consider detecting and retrying stream hangs faster than the full idle-watchdog delay.
Terminal/Shell detail:
- Primary terminal: kitty.
- Also reproduced in the built-in macOS Terminal.app, so this does not appear to be kitty-specific.
Session/debug artifacts:
- I have the corresponding Claude Code conversation/session transcript and debug log for at least one occurrence.
- I can provide sanitized excerpts or request IDs privately if maintainers need them.
- I am not attaching the full transcript publicly because it may contain local project paths, prompts, filenames, and other project/context details.
Anthropic feedback reference:
- I already submitted an in-product Claude Code feedback report for this issue, including the corresponding session/conversation details.
- Feedback ID: ce515f85-8f15-4669-abce-3471ad252167
- The feedback flow asked me to also file a GitHub issue and include this Feedback ID, so maintainers should be able to correlate this public report with the private session details internally.
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I don't think this is an exact duplicate.
The linked issues are related, especially #46745 and #66095, but this report adds a specific long-term regression boundary and machine/model comparison:
ce515f85-8f15-4669-abce-3471ad252167.So I agree this is likely related to the stream-stall family, but I would like to keep this issue open because it provides a narrower version boundary and hardware/model comparison that may help isolate the regression.
One more narrowing data point:
After 2.1.154, Sonnet continues to work normally on the same affected machine. The regression appears specific to Opus 4.8 / 1M context behavior.
So the pattern is:
This further suggests the issue is not a general Claude Code, terminal, network, or account problem, but something specific to the Opus 4.8 path introduced around 2.1.154.
Update: testing 2.1.199 + Opus 4.8 (1M)
Quick status update — I've been running 2.1.199 with Opus 4.8 (1M context) for about a day now, and so far I have not been able to reproduce the stream-hang. Previously the hang would occur within a short session ("not long before it stalls"), so the change in behavior is noticeable.
Caveats before anyone treats this as fixed:
Keeping this open for now until I can confirm it holds across longer sessions. Will report back.
Follow-up: reproduced on 2.1.199 ~1 hour after the previous update — possible link to interrupting model tool_use / subagent calls
Just ~1 hour after posting the previous "not reproduced yet" update, I hit the same stream hang on 2.1.199 + Opus 4.8 (1M). I have a possibly-useful lead this time. Observations first, timeline at the bottom for anyone who wants to dig.
---
Main observation (user-level, from ~1 month of testing):
Throughout my testing across 2.1.154–197, I frequently interrupted the model's tool_use / subagent calls (this is a normal part of how I use Claude Code). Subjectively, I noticed that hangs seem particularly prone to occur after I've interrupted the model. This is user-perceived correlation, not a rigorously proven cause, but the pattern has been consistent enough over several weeks that I think it's worth flagging. Interrupting may not be a necessary trigger, but it does appear to significantly raise the probability of a stream stall.
Today's stall on 2.1.199 matched the same pattern: I interrupted a Skill call that was mid-way through launching a subagent → over the next few minutes the assistant hit multiple stream stalls (91s / 84s / 59s of complete silence) → eventually the session went fully unresponsive.
---
Three side-observations that might help debugging:
Shell cwd was reset to <home>. I suspect this is related to shell state being cleaned up after the earlier interrupted subagent/skill.promptId, sameparentUuid, 91s apart), but I have no memory of resending it. Could be an unconscious re-tap while the UI was frozen, a duplicate keyboard event, or some client-side resend mechanism — either way, it's an observable side symptom of the hang state and worth noting.---
Hypothesis:
When a Skill that's mid-subagent-launch gets interrupted, incomplete tool_use / shell state may be left in either the client or the model's context. The model doesn't fail immediately; instead it enters a half-dead intermittent stream-stall state, and eventually stops emitting any events at all after some tool_result. The symptom itself ("stream stops after the first chunk") matches the original issue exactly — but this run adds a suspicious preceding trigger pattern.
---
Detailed timeline (for anyone digging,
T= trigger moment, taken from session transcript):T: User interrupts a Skill call that was mid-way through launching a subagentT + 6s: User sends next prompt ("I want to tweak this skill") → assistant sends a short reply andend_turn— looks normalT + 46s: User sends next prompt (about how to redesign the skill) → assistant produces no response at allT + 137s: The same prompt is recorded again as an independent submission (user does not remember resending)T + 150s: Assistant revives, sends a short text + aReadon the skill's SKILL.mdT + 150s ~ T + 234s: After the Read tool_result returns, ~84s with no assistant eventsT + 234s: Assistant revives again, emits a chunk of text (containing the "environment output keeps getting polluted" self-report), then callsBash(git show ...)giterror, and the tool_result carries the Claude-Code-injectedShell cwd was reset to <home>noticeT + 241s ~ T + 300s: ~59s with no assistant events---
Keeping the issue open. 2.1.199 does not fix this bug. No
--debug apilog this time; I'll capture one next time. Happy to share sanitized transcript excerpts if useful.Additional data point: restoring the conversation to before the interrupt fully recovered the model, verified across many turns
After the hang event above, I restored the conversation to a checkpoint from before the interrupted subagent call, and continued talking on the same session, same machine, same 2.1.199, same Opus 4.8 (1M). The model immediately recovered to normal behavior, and has since continued to respond stably across many turns with no further stream stalls at all.
This is a fairly clean A/B contrast — the only variable is whether the interrupted subagent call is left in the conversation context:
This rules out "time-of-day coincidence", "transient network hiccup", and "temporary server-side state" as the cause. It strongly supports the inference that the hang does not live in the current machine / network / model-server state, but in the residue that the interrupted subagent tool_use leaves behind in the context itself. Once the context is clean, the same model runs stably.
Suggested direction for debugging: worth checking whether, when a subagent-launching call is interrupted, the client-side conversation history sent to the API is left with an asymmetric structure (e.g. a
tool_useblock without a matching completetool_result), and whether Opus 4.8 in 1M-context mode stream-stalls specifically when it encounters that malformed structure.