claude-code - 💡(How to fix) Fix [BUG] TUI input freezes randomly mid-typing — entire prompt becomes unresponsive for minutes

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…

Error Message

  • No error messages or logs — the TUI just silently stops rendering

Error Messages/Logs

(no error output; TUI input render stalls silently)

Code Example

(no error output; TUI input render stalls silently)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report
  • 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.

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