claude-code - 💡(How to fix) Fix [BUG] Input invisible / cursor frozen for up to 20s after /compact, then dumps at once

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

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?

Immediately after /compact finishes, the input prompt appears responsive but is not. Typing produces no visible cursor movement and no echoed characters for up to ~20 seconds. Once the stall ends, the entire typed buffer appears at once in the input box. The keystrokes were not lost, they were just not rendered until the TUI unblocked.

This is distinct from #18943 (lag when context is full). In this report the context has just been freshly compacted, so usage is low. The stall is tied to the post-compact transition, not to context size.

What Should Happen?

After /compact completes and the prompt is redrawn, keystrokes should be echoed immediately (sub-50ms). The cursor and typed characters should appear as the user types, not in a single deferred flush.

Error Messages/Logs

(no error output; TUI input render stalls silently)

Steps to Reproduce

  1. Start a Claude Code session and do enough work to make /compact meaningful (or just run it on any session).
  2. Run /compact and wait for it to report completion and re-render the input prompt.
  3. As soon as the new prompt appears, start typing a message.
  4. Observe: no cursor movement, no characters appear. The TUI looks frozen.
  5. After up to ~20 seconds, the entire typed string appears at once in the input box and the cursor catches up.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

(unknown)

Claude Code Version

2.1.139 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Keystrokes are buffered correctly (no characters lost), so this looks like a TUI render/event-loop stall on the immediate post-compact transition rather than an stdin handling bug.
  • Possible related work happening during the stall: post-compact summary persisting, prompt-cache warm-up, status line or token-count recomputation against the freshly compacted transcript, file/index rehydration.
  • Related but different: #18943 (input lag correlated with high context usage). This bug occurs when context is freshly low immediately after compaction.

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 [BUG] Input invisible / cursor frozen for up to 20s after /compact, then dumps at once