Vibe Coding
PostCompact Hook Pattern: Programmatic Context Re-Injection After Compaction
The new PostCompact hook in Claude Code 2.1.76 fires after compaction completes and receives the full compact_summary alongside the trigger source — giving developers the first deterministic entry point to observe what was lost and act on it. Unlike other hooks it has no decision control and cannot cancel compaction, but it can write critical instructions back to CLAUDE.md, push the summary to an external system, or spawn a follow-up task. Combined with the new autoMemoryDirectory setting this forms a complete memory lifecycle control surface.
Source
↳ Follow the thread