Listing exactly what survives compaction from disk versus what gets flattened into the summary clears up why long agent sessions suddenly drift after two hours. Chat-only constraints feel permanent while you are typing them, yet they are the first details smoothed away during summarization.
Using a SessionStart hook with the compact matcher to re-inject live state like recent git commits and active checklist items is much more reliable than relying on the model to remember prior turns. Keeping durable invariants in root CLAUDE.md while storing volatile step progress in an external file keeps both halves predictable.