claude-code - 💡(How to fix) Fix REPL crash: terminal render overflow on large Edit output (860K chars) [5 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#46190Fetched 2026-04-11 06:26:47
View on GitHub
Comments
5
Participants
2
Timeline
9
Reactions
0
Timeline (top)
commented ×5labeled ×4

Claude Code crashes when the model generates a large Edit tool call response. The terminal render buffer overflows, causing the REPL to unmount immediately.

Root Cause

Claude Code crashes when the model generates a large Edit tool call response. The terminal render buffer overflows, causing the REPL to unmount immediately.

Code Example

# Normal frame just before crash:
[DEBUG] High write ratio: blit=0, write=23690 (100.0% writes), screen=228x79

# Crash frame — screen height jumps 57x, write volume jumps 36x:
[DEBUG] High write ratio: blit=0, write=860108 (100.0% writes), screen=12960x79
[DEBUG] [REPL:unmount] REPL unmounting
RAW_BUFFERClick to expand / collapse

Description

Claude Code crashes when the model generates a large Edit tool call response. The terminal render buffer overflows, causing the REPL to unmount immediately.

Steps to reproduce

  1. Ask Claude Code to perform an edit that results in a large output
  2. The model generates a response with a large Edit tool call
  3. The REPL crashes

Debug log analysis

The terminal render goes from normal to catastrophic in a single frame:

# Normal frame just before crash:
[DEBUG] High write ratio: blit=0, write=23690 (100.0% writes), screen=228x79

# Crash frame — screen height jumps 57x, write volume jumps 36x:
[DEBUG] High write ratio: blit=0, write=860108 (100.0% writes), screen=12960x79
[DEBUG] [REPL:unmount] REPL unmounting

The screen went from 228 → 12,960 lines and write volume from 23K → 860K characters in a single render cycle. The REPL unmounts immediately after.

Timeline

  1. A streaming stall of 55.4s occurred (Streaming stall detected: 55.4s gap between events)
  2. After the stall, the response completed with an Edit tool call (permission prompt shown)
  3. On the next render frame, the buffer exploded to 860K chars → crash

Expected behavior

The render engine should handle large outputs gracefully — truncate, paginate, or stream incrementally instead of writing 860K characters in a single frame.

Environment

  • Claude Code version: 2.1.100
  • OS: macOS (Darwin 25.3.0)
  • Model: claude-opus-4-6 (1M context)

extent analysis

TL;DR

Implementing a mechanism to truncate or paginate large Edit tool call responses could prevent the terminal render buffer overflow and subsequent REPL crash.

Guidance

  • Investigate the render engine's handling of large outputs to identify potential improvements, such as incremental streaming or truncation.
  • Consider implementing a character limit or pagination for Edit tool call responses to prevent buffer overflows.
  • Review the debug log analysis to understand the relationship between the streaming stall, response completion, and buffer explosion.
  • Analyze the Claude Code version and model configuration to determine if there are any known issues or limitations that may be contributing to the problem.

Example

No specific code snippet can be provided without further information about the render engine and Edit tool call implementation.

Notes

The solution may depend on the specific implementation details of the render engine and Edit tool call, which are not provided in the issue description. Additionally, the Claude Code version and model configuration may have known issues or limitations that need to be considered.

Recommendation

Apply a workaround, such as implementing a character limit or pagination for Edit tool call responses, to prevent buffer overflows and subsequent REPL crashes. This is a temporary solution until a more robust fix can be implemented in the render engine.

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…

FAQ

Expected behavior

The render engine should handle large outputs gracefully — truncate, paginate, or stream incrementally instead of writing 860K characters in a single frame.

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 REPL crash: terminal render overflow on large Edit output (860K chars) [5 comments, 2 participants]