[BUG] TUI render desyncs into transient in-place character scrambling when multiple agents run concurrently (self-recovers)

Resolved 💬 2 comments Opened Jun 2, 2026 by amilovidov Closed Jun 6, 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?

When multiple agents/subagents run concurrently, the TUI render desyncs and the static (scrollback) region of the screen shows in-place character-level corruption: characters within otherwise-correctly-laid-out lines are dropped, transposed, or replaced with stray characters. The layout/structure stays intact — it's the cell contents that get scrambled.

Representative corruptions (left = corrupted, right = intended):

  • cd ;Users/...cd /Users/... (leading / replaced)
  • ls doc3/ | g" p -ils docs/ | grep -i
  • sqli 3 "$DB" / sqli e3 "$DB"sqlite3 "$DB"
  • SEL CT colSELECT col
  • WHER status='...'WHERE status='...'

It is distinct from:

  • #59239 (glyph fragmentation, persistent, requires a terminal reset) — this one is transient and self-recovers.
  • #40574 (CJK/Unicode �� mojibake) — here the scrambled text is plain ASCII.

Characteristics:

  • Transient — self-recovers within a few seconds once concurrent rendering settles (confirmed: a screenshot of the same window ~2 min later renders cleanly).
  • Triggered by concurrency — appears specifically while several Agent(...) tasks render/update simultaneously (the affected frame had multiple live agents, a spinner, a backgrounded agent line, and "+13 tool uses" all updating at once).
  • Cell-content level, not glyph-level — box-drawing, indentation, and line wrapping are correct; only the text inside cells is scrambled.

Reads like the diff-based screen renderer racing/desyncing its cell buffer under high concurrent write throughput from multiple agents.

What Should Happen?

Concurrent agent output should render to the correct cells. Heavy simultaneous updates from multiple agents should not scramble already-committed scrollback text.

Steps to Reproduce

  1. macOS, Terminal.app, zsh.
  2. Run a session that spawns multiple concurrent agents/subagents, each emitting substantial Bash/tool output (e.g. several Agent(...) in parallel, plus a background agent and an active spinner).
  3. Watch the scrollback region while the agents update simultaneously — text in committed lines gets character-scrambled.
  4. Wait a few seconds → it renders correctly again (self-recovers).

Environment

  • Claude Code: 2.1.160
  • OS: macOS 26.4.1 (build 25E253)
  • Terminal: Apple_Terminal (Terminal.app), ~146x39
  • Shell: zsh
  • TERM: xterm-256color

Related

  • #59239 (garbled/unreadable — persistent, needs terminal reset; this one is transient)
  • #8618 (general TUI rendering corruption)
  • #29937 (tmux render overlap — Linux)

View original on GitHub ↗

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