[BUG] Post-compact screen overwrites existing terminal content instead of clearing (PowerShell / Windows Terminal)
Environment
- OS: Windows 11 Pro (10.0.26200)
- Terminal: PowerShell in Windows Terminal
- Claude Code: Intermittent across multiple versions (current and prior)
Description
After context compaction (auto or manual /compact), the post-compact redraw overwrites the existing terminal content in-place rather than clearing the screen first. This leaves visual residue — fragments of the pre-compact output bleed through behind the new content, making the session unreadable.
The screenshot below shows the post-compact state where raw JSON/markdown from the compacted context summary renders on top of the previous tool-call output (Read operations, file paths, line counts), producing garbled overlapping text.
Expected Behavior
Post-compact should clear the viewport (or scroll past existing content) before rendering the fresh state, so the user sees a clean post-compact screen.
Actual Behavior
New content renders on top of old content at the same cursor position, producing garbled overlapping text. The pre-compact output (tool calls, file reads) remains visible underneath the post-compact summary.
Reproduction
- Start a Claude Code session in PowerShell (Windows Terminal)
- Run enough conversation to trigger auto-compact (or run
/compact) - Observe that the post-compact screen overwrites existing terminal lines instead of clearing first
Frequency: Intermittent — does not happen every compact, but has appeared across multiple versions. Not always reproducible on demand.
Screenshot
!Post-compact rendering residue
(Visual shows pre-compact Read tool output bleeding through post-compact summary text)
Related Issues
- #24705 — Context compaction should NOT reset/clear the terminal (inverse problem: clears too aggressively)
- #18204 — Compaction clears screen - can't scroll up to see previous context
- #7597 — /compact and /clear commands clear terminal scrollback buffer
- #19637 — Windows: text overlapping and garbled display since v2.1.3
- #27360 — Windows silent crash due to unbounded screen buffer with blit=0
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗