Windows: Context compaction triggers when terminal window is minimized

Resolved 💬 3 comments Opened Apr 2, 2026 by AmericP Closed Apr 6, 2026

Description

Context compaction fires unexpectedly when the Claude Code terminal window is minimized and restored on Windows 11. This happens during active sessions — minimizing the window and coming back triggers compaction even when the conversation is well within context limits.

Environment

  • Claude Code version: 2.1.90
  • OS: Windows 11 Pro (10.0.26200)
  • Shell: bash (Git Bash)
  • Terminal: Windows Terminal

Steps to Reproduce

  1. Start a Claude Code session with moderate context usage
  2. Minimize the terminal window
  3. Leave minimized briefly
  4. Restore the window
  5. Compaction fires despite context not being near limits

Expected Behavior

Minimizing/restoring the terminal window should not trigger context compaction.

Actual Behavior

Context compaction fires on window restore, losing conversation context mid-session. This appears to be a focus/visibility event incorrectly triggering a context re-evaluation cycle.

Notes

  • Started occurring around 2026-04-02 (possibly related to a recent update)
  • No custom hooks trigger compaction — only a PostCompact hook that fires after compaction to restore session state
  • Reproducible across sessions

View original on GitHub ↗

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