When to Use This Skill
- After context compaction, the session has lost critical context (active org alias, in-progress deployment state, pending evidence bundle) that needs to be re-hydrated
- The PreCompact hook is not saving scratchpad state correctly — diagnosing what is missing or malformed in the saved context file
- Configuring the session-stop persistence hook to capture a richer snapshot before a long session ends
- Validating that transcript backup controls are operating correctly (backup exists at the expected path, is not stale)
- Recovering a session after an unexpected Claude Code crash by loading the most recent scratchpad state
Not for: Context budget management within an active session — use context-budget-guardrails-framework for throttling tool use before compaction is needed.
Hook Event Map
| Hook Event | Purpose | Output Location |
|---|
| PreCompact | Extract and save session state before compaction |