Terminal rendering corruption when multiple background agents write concurrently
Description
When running 4+ background agents simultaneously, the streaming status lines below the agent tally table become corrupted with scattered single characters (d, C, n, h, f, etc.) interleaved between real output lines.
Steps to Reproduce
- Launch 4+ background agents (e.g. via a parallel dispatch skill or multi-agent orchestration)
- Observe the live status output in the terminal as agents complete and emit status lines
Expected Behavior
Status lines render cleanly without corruption.
Actual Behavior
Random characters appear between status lines — fragments of ANSI escape sequences or raw bytes from concurrent writes. The agent tally table at the top renders correctly (likely written atomically), but the streaming lines below it are garbled.
Root Cause (suspected)
Multiple background agent processes share a single TTY and write status updates without coordinated locking. At high concurrency, writes interleave at the byte level, fragmenting escape sequences and text mid-write.
Environment
- Claude Code CLI
- macOS (Darwin 24.6.0)
- Shell: bash
- Reproduced with 4 concurrent background agents
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗