Context compaction loses critical state and stale background shell reminders persist

Resolved 💬 4 comments Opened Dec 21, 2025 by Aaron-RealFinance Closed Feb 14, 2026

Bug Description

After context compaction, Claude Code:

  1. Loses track of current task state
  2. Keeps showing stale "Background Bash" system reminders from days-old sessions
  3. References old BashOutput data (e.g., errors from Dec 19th when current date is Dec 21st)
  4. Cannot clear these stale reminders even after killing shells

Expected Behavior

  • Context compaction should preserve current task state
  • Stale background shell reminders should be cleared or marked as stale
  • KillShell should stop the system reminders from appearing

Actual Behavior

  • After compaction, Claude loses context of what user is working on
  • System reminders like Background Bash 95c29c ... Has new output available persist indefinitely
  • Even after KillShell returns "Shell is not running", the reminders continue
  • Claude acts on stale data from old sessions, confusing the user

Impact

  • Major productivity loss - user has to re-explain context repeatedly
  • Trust erosion - Claude appears confused and unreliable
  • Incorrect actions - Claude may act on days-old error messages

Reproduction

  1. Start a long session with background bash commands
  2. Let session run until context compaction occurs
  3. Observe stale shell reminders persisting
  4. Try to kill shells - reminders continue

Environment

  • Claude Code CLI
  • Model: claude-opus-4-5-20251101
  • Platform: macOS Darwin 24.6.0

View original on GitHub ↗

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