[BUG] History recall via up arrow renders corrupted text when agent is active

Resolved 💬 3 comments Opened Apr 29, 2026 by hmoss-01 Closed May 3, 2026

Environment

  • OS: Windows 11 Enterprise
  • Terminal: Windows Terminal
  • PowerShell: 7.6.1
  • Claude Code version: TBD (check with claude --version)

Describe the bug

When using the up arrow key to recall a previous prompt from history while an agent is running or has recently completed, the recalled prompt text displays as corrupted/garbled characters in the input area. The text in history.jsonl is stored correctly — the corruption is a rendering artifact only.

Additionally, agent status lines (e.g. * Baked for 16siple days?, * Gusting...) appear overlapping the recalled prompt text in the same terminal area, suggesting the input recall and agent status output are painting to the same terminal region simultaneously.

Steps to reproduce

  1. Start a session and send several prompts
  2. Spawn a subagent (e.g. via Agent tool)
  3. While the agent is running or just after it completes, press the up arrow key to recall a previous prompt
  4. Observe the recalled text in the input area

Expected behavior

The recalled prompt text displays cleanly in the input area, matching what was originally typed.

Actual behavior

The recalled text displays with garbled/concatenated characters. Agent status lines overlap the input area.

Additional context

The history file stores the original prompt verbatim and correctly — confirmed by reading history.jsonl directly. The issue is isolated to terminal rendering during history recall.

Related open issue: #52866 (terminal re-render during sequential tool calls) appears to be in the same rendering area but a different trigger.

Duplicate scrub

The GitHub bot flagged 3 potentially related issues. Upon review none are exact matches:

  • #1509 — Closest match. Same symptom (random characters in input area while agent running) but reported on MacOS/iTerm2. Missing the specific trigger (history recall via up arrow) and steps to reproduce. Our report adds Windows/PowerShell 7.6.1 context and identifies the exact trigger.
  • #19637 — Related but different. Windows cmd.exe garbled rendering introduced in v2.1.3-v2.1.5. Broader UI rendering issue, not specific to the input/history area.
  • #43571 — Different trigger, same rendering layer. Concurrent background agents corrupting status lines. Same underlying terminal rendering problem but a different cause.

This report is specific to the history recall + agent status overlap on Windows and is not a duplicate of any of the above.

View original on GitHub ↗

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