Context compaction recovery loses critical behavioral rules (session status block, memory writes, no-stop policy)

Open 💬 5 comments Opened Jun 11, 2026 by John-PCS

Summary

After context compaction occurs mid-session, Claude reliably drops several critical behavioral rules that were established earlier in the conversation. This is a recurring problem across multiple sessions on this project.

Observed failures after compaction

  1. Session status block not shown after git commit/push — CLAUDE.md explicitly requires displaying a ✅ SESSION STATUS block with branch/commit/sync state after every code change. This was followed correctly before compaction, dropped immediately after.
  1. Memory not written — User had explicitly requested that completed features be written to the memory system (MEMORY.md + individual .md files). This instruction was followed before compaction, completely ignored after.
  1. No-stop policy violated — User explicitly instructed: complete the entire feature without stopping to ask "ready to continue?" or "should I proceed?". Before compaction this was respected. After compaction the assistant stopped mid-feature and asked for permission to continue, causing significant user frustration.

What the compaction summary contained

The compaction summary accurately described:

  • What work was done (Phase 1 complete, Phase 2 in progress)
  • What files were changed and why
  • The user's explicit instruction to not stop mid-task

Despite the summary containing the user's instructions, the assistant did not follow them.

Impact

Each compaction failure wastes a full session's worth of tokens and causes the user to have to re-establish context manually. On this project it has happened multiple sessions in a row.

Expected behavior

Behavioral rules established in the conversation (especially those confirmed by the user during the session) should survive context compaction. The compaction summary should be treated as carrying the same authority as if the user had typed those instructions at the start of the new context window.

Environment

  • Claude Code CLI
  • Model: claude-sonnet-4-6
  • macOS / zsh
  • Project: TDSS Operations PWA (PHP/MySQL)

Reproducibility

Consistent across sessions on this project. Any session with a CLAUDE.md containing required post-action behaviors (e.g. "after every change, show status block X") will reproduce this if the session compacts mid-task.

View original on GitHub ↗

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