TUI goes blank/unresponsive after model turn completes (high write ratio render)

Resolved 💬 2 comments Opened Apr 9, 2026 by jayervilha Closed May 23, 2026

Description

Claude Code TUI intermittently goes completely blank/unresponsive, requiring a process kill and restart. The screen appears frozen — no input is accepted, no output is rendered.

Environment

  • Claude Code version: 2.1.97
  • OS: Linux 6.8.12-16-pve (Proxmox/Debian)
  • Terminal: Kitty (via SSH)
  • Screen size: 50 rows × 191 columns
  • Shell: bash
  • Relevant env vars: CLAUDE_CODE_NO_FLICKER=1

Reproduction

  • Frequency: Multiple times per day across different sessions
  • Not reliably reproducible on demand — happens intermittently during normal usage
  • Initially suspected /clear as the trigger, but debug logging reveals the TUI dies before /clear is issued — during a normal render cycle after the model finishes a turn

Debug Log Evidence

Enabled --debug logging and captured the failure. The debug log for the affected session (1f2185dc) ends abruptly:

18:40:24.407Z [DEBUG] Hook Stop (Stop) success: {"continue":true}
18:40:24.411Z [DEBUG] Preserving file permissions: 100600
18:40:24.411Z [DEBUG] Writing to temp file: .../.claude.json.tmp.1933138.1775760024411
18:40:24.419Z [DEBUG] Temp file written successfully, size: 34179 bytes
18:40:24.419Z [DEBUG] File /home/.../.claude.json written atomically
18:40:24.420Z [DEBUG] [useDeferredValue] Messages deferred by 5 (1165→1170)
18:40:24.432Z [DEBUG] [BackendRegistry] isInProcessEnabled: true (mode=auto, insideTmux=false, inITerm2=false)
18:40:24.436Z [DEBUG] High write ratio: blit=191, write=3259 (94.5% writes), screen=50x191
--- LOG ENDS HERE (no further entries, no SessionEnd, no crash logged) ---

Key observations

  1. No /clear or SessionEnd events — the TUI died during a normal render cycle after model turn completion + Stop hooks
  2. useDeferredValue: Messages deferred by 5 (1165→1170) — React/Ink renderer was batching 5 message updates into one render right before death
  3. High write ratio: blit=191, write=3259 (94.5% writes) — the terminal backend was doing 3259 raw write operations with minimal blit (buffer copy) optimization
  4. In-process backend (isInProcessEnabled: true) — not using an external process for rendering
  5. Wide terminal (191 columns) — more data per write operation
  6. The process continues running (can be killed with Ctrl+C) but the TUI is completely blank — suggests the render loop crashed or hung, not the main process

Comparison with a second captured failure

An earlier session (08f93d27) shows the same pattern — log ends after High write ratio: blit=0, write=2912 (100.0% writes) with no further entries. That one happened during a /clear operation, so both /clear and normal turn completion can trigger it.

Suspected Root Cause

The in-process terminal backend's render cycle appears to fail/hang when:

  • Multiple message updates are batched (useDeferredValue deferring 5+ messages)
  • The resulting render produces a high write ratio (94-100% raw writes, minimal blit)
  • On a wide screen (191 columns = more data per write)

The TUI renderer stops writing to the debug log and stops accepting input, but the process stays alive.

Workaround

Starting a new session. No configuration or hook changes resolve it.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗