claude-code - 💡(How to fix) Fix Gibberish/garbled output on Opus 4.7 leaves CLI unrecoverable, forced full restart (Windows) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53159Fetched 2026-04-26 05:22:53
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Root Cause

Working on a multi-day v2 database-migration effort (SQLite → Postgres). Long conversation, 1M context window, lots of tool use (Bash, Read, Edit), interleaved with subagent spawns. The crash hit while I was in the middle of porting/dispatching pipeline stages — I don't have the exact transcript because I had to power-cycle the machine.

Fix Action

Fix / Workaround

Working on a multi-day v2 database-migration effort (SQLite → Postgres). Long conversation, 1M context window, lots of tool use (Bash, Read, Edit), interleaved with subagent spawns. The crash hit while I was in the middle of porting/dispatching pipeline stages — I don't have the exact transcript because I had to power-cycle the machine.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for related reports
  • This is a single bug report
  • I am using the latest version of Claude Code

Environment

  • Claude Code: v2.1.119
  • Model: claude-opus-4-7[1m] (Opus 4.7, 1M context)
  • Account: Claude Max
  • Platform: Windows 11 Pro 10.0.26200
  • Shell: bash (Git Bash) under Windows Terminal
  • Date of incident: 2026-04-24

What happened

Mid-session, Claude Code began streaming gibberish/garbled text into the terminal. The session became unresponsive — I could not interact with the CLI any further (couldn't cancel, couldn't submit a new prompt, couldn't exit cleanly). I had to shut down the computer to recover; closing the terminal alone was insufficient.

This is the second time this has happened to me — a previous occurrence was also during heavy long-context work on the same repo, also on Opus.

Context at time of failure

Working on a multi-day v2 database-migration effort (SQLite → Postgres). Long conversation, 1M context window, lots of tool use (Bash, Read, Edit), interleaved with subagent spawns. The crash hit while I was in the middle of porting/dispatching pipeline stages — I don't have the exact transcript because I had to power-cycle the machine.

Why this is worse than the known garbled-output bug

I'm aware of #45712 (Opus garbled multi-script output) which describes a transient model glitch that recovers on the next prompt. My case is different in severity:

  • The CLI itself becomes unresponsive — not just one bad assistant turn.
  • No way to Ctrl+C out or send a new prompt to recover.
  • A full OS restart was required.

It may share a root cause (Opus token-selection corruption) but the failure mode for the user is "CLI is bricked until reboot," not "model produced one bad reply."

What I'd find useful

  1. A timeout / watchdog that aborts the streaming render and returns the user to a working prompt if the model output goes off the rails.
  2. Some way to dump the in-memory transcript to disk before the session locks up, so I don't lose the conversation when forced to power-cycle.
  3. A confirmation of whether this is the same root cause as #45712 or a separate Windows-specific TUI issue.

Related

  • #45712 — Opus garbled multi-script output (likely related model-side cause)
  • #26224 — Claude Code hanging/freezing (similar user impact, different trigger)
  • #30346 — Multiple sessions crash with ANSI escape codes on Windows (possibly related TUI rendering)

I don't have a transcript to attach because the session was unrecoverable. Happy to provide more detail if there's a way to surface a recent session log post-reboot.

extent analysis

TL;DR

Implement a timeout or watchdog mechanism to abort streaming render and return to a working prompt when model output becomes unresponsive.

Guidance

  • Investigate the relationship between this issue and #45712 to determine if the root cause is the same Opus token-selection corruption.
  • Consider adding a feature to dump in-memory transcripts to disk before a session locks up to prevent data loss.
  • Review related issues #26224 and #30346 to identify potential Windows-specific TUI rendering problems that may be contributing to the issue.
  • Look into implementing a mechanism to detect and recover from unresponsive model output, such as a timeout or watchdog.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The issue lacks a transcript, which makes it difficult to diagnose the problem. However, the user's description and related issues suggest a potential connection to Opus token-selection corruption and Windows-specific TUI rendering problems.

Recommendation

Apply a workaround, such as manually monitoring the model output and interrupting the process when it becomes unresponsive, until a more permanent solution can be implemented. This is because the issue is severe and causes the CLI to become unresponsive, requiring a full OS restart to recover.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Gibberish/garbled output on Opus 4.7 leaves CLI unrecoverable, forced full restart (Windows) [1 comments, 2 participants]