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:
- Loses track of current task state
- Keeps showing stale "Background Bash" system reminders from days-old sessions
- References old BashOutput data (e.g., errors from Dec 19th when current date is Dec 21st)
- 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 availablepersist 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
- Start a long session with background bash commands
- Let session run until context compaction occurs
- Observe stale shell reminders persisting
- Try to kill shells - reminders continue
Environment
- Claude Code CLI
- Model: claude-opus-4-5-20251101
- Platform: macOS Darwin 24.6.0
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗