[BUG] Terminal graphics residue after context compaction

Resolved 💬 3 comments Opened May 11, 2026 by EnjouZeratul Closed Jun 10, 2026

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

  1. Have a long conversation until context is near limit
  2. Trigger compaction (manual /compact or auto-compact)
  3. Observe terminal after compaction completes
  4. 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.

View original on GitHub ↗

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