[BUG] Terminal graphics residue after context compaction
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [ ] I am using the latest version of Claude Code
What's Wrong?
After context compaction (/compact or auto-compact), old content appears as static bitmap residue overlaid on the current terminal output. The residue shows fragments of previous conversation, sometimes cutting through the middle of CJK characters.
Notably, the same corrupted glyph always shows the same incorrect bitmap - indicating a cached texture issue rather than random rendering errors.
What Should Happen?
Terminal display should be clean after compaction.
Steps to Reproduce
- Have a long conversation until context is near limit
- Trigger compaction (manual
/compactor auto-compact) - Observe terminal after compaction completes
- Old content appears as static bitmap residue overlaid on current display
Workaround: Splitting the terminal pane and immediately closing it forces the terminal to rebuild the rendering surface, which clears the residue.
Claude Code Version
2.1.80
Is this a regression?
No, this never worked
Platform
Other
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
This appears related to terminal GPU texture cache not being properly cleared. The split-pane workaround suggests the issue is with terminal rendering state.
I tested configuring PostCompact hook to send terminal refresh sequences, but as noted in #35816, it runs in a subprocess and cannot affect the main process's terminal display.
Related Issues:
- #35816: Status line does not refresh after
/compact - #54536: PostCompact hook request
I've also reported the terminal-layer issue to VS Code: https://github.com/microsoft/vscode/issues/315782. However, it would be helpful if Claude Code could provide an application-layer solution by sending a refresh sequence after compaction, rather than waiting for terminal fixes.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗