Post-Compact Reminder: A Claude Code Hook to Prevent Rule Amnesia After Compaction

doodlestein · x · 2026-08-05

During long coding sessions, Claude Code often forgets AGENTS.md rules after context compaction. To solve this, a developer open-sourced postcompactreminder, a hook that detects compaction and injects a reminder for the model to re-read the rules, preventing post-compaction amnesia.

Original post →

More from coding & agent

coding & agent channel →