[BUG] TUI input freezes randomly mid-typing — entire prompt becomes unresponsive for minutes

Resolved 💬 1 comment Opened May 28, 2026 by cmhungksu Closed Jun 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

While typing a prompt (not during tool execution or thinking), the TUI randomly freezes. The cursor stops moving, no characters appear on screen, and the entire input becomes unresponsive. This happens mid-keystroke — not triggered by any special action like /compact or holding arrow keys.

Key observations:

  • Happens during normal typing, especially (but not exclusively) when using arrow keys to reposition the cursor
  • The freeze lasts 3–4 minutes then sometimes auto-resolves, with all buffered keystrokes dumped at once
  • Forcing a terminal redraw (e.g. tmux detach then tmux attach -t) immediately unfreezes it — confirming this is a render stall, not an stdin issue
  • Not related to tmux: happens identically without tmux, in a bare terminal
  • Not related to system load: happens even with minimal Docker containers / low CPU usage
  • Occurs multiple times per day during heavy usage sessions
  • No error messages or logs — the TUI just silently stops rendering

What Should Happen?

Keystrokes should be echoed immediately at all times. The TUI render loop should never block the input event loop.

Error Messages/Logs

(no error output; TUI input render stalls silently)

Steps to Reproduce

  1. Start a Claude Code session
  2. Begin typing a prompt (any length)
  3. Optionally use left/right arrow keys to move the cursor within the text
  4. At some unpredictable point, the screen freezes — no cursor movement, no character echo
  5. Wait 3-4 minutes for auto-recovery, or force a terminal redraw (e.g. re-attach tmux)
  6. All buffered keystrokes appear at once

No reliable minimal repro — it's intermittent but frequent (several times per day with heavy usage).

Claude Model

Opus

Is this a regression?

I don't know — it has been present for as long as I've used Claude Code.

Last Working Version

_No response_

Claude Code Version

2.1.109 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu 24.04 (Linux 6.8.0-117-generic)

Terminal/Shell

bash under tmux (tmux-256color), also reproduces in bare gnome-terminal

Additional Information

  • Previously reported as #35903 (arrow key freeze), #58498 (post-compact freeze), #31194 (persistent TUI render lag), #25286 (100% write ratio in renderer) — all were closed as inactive but the underlying issue persists.
  • The symptom pattern (keystrokes buffered correctly but not rendered, forced redraw fixes it) strongly suggests the TUI render loop is being blocked, likely by synchronous work on the main thread (timers, status updates, token recomputation, etc.).
  • This is distinctly a TUI rendering issue, not a network/API/model issue — the backend continues working fine; only the input display is frozen.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗