npx claudepluginhub nbkm8y5/claude-plugins --plugin session-resilienceDefined in hooks/hooks.json
{
"PreCompact": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Before this context is compressed, update the session state file at .claude/session-state.md. Read the file if it exists, then update it with the current state following the schema in ${CLAUDE_PLUGIN_ROOT}/skills/incremental-summarization/references/state_schema.md. Capture: session goal, all decisions made and their rationale, any issues found with severity, work completed with files touched, the current in-progress task, next steps in priority order, and any key context that would be lost on compression and cannot be derived from code or git history. If the file does not exist, create it. Be thorough — this is the only record that will survive compression."
}
],
"matcher": ""
}
]
}"Runs Python script pre_compact_export.py before PreCompact events (auto or manual matcher). No bash execution or file writes."