Defined in hooks/hooks.json
{
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/validate-progress.js",
"timeout": 120,
"description": "Validates documentation, runs work item verification commands, updates feature_list.json"
}
],
"enabled": true,
"priority": 95,
"description": "Pre-validate PROGRESS.md and feature_list.json, run verification commands"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "You are evaluating whether this Claude Code session can stop. A pre-validation script has already run and its output is included in the context.\n\nReview the validation results and session context to determine:\n\n## 1. Feature Work Item Status (if feature_list.json exists)\n\nCheck `details.featureList` in validation output:\n- If `currentWorkItem` exists and `verificationResults.requiredPassed` is true:\n - Work item was verified and marked complete ✅\n - This is a clean session end\n- If `currentWorkItem` exists and `verificationResults.requiredPassed` is false:\n - Verification FAILED - block session end\n - Show which tests failed from `verificationResults.tests`\n - Request fixes before allowing session to end\n- If `currentWorkItem` has no verification commands:\n - Warn but don't block - ask user to confirm work is complete\n\n## 2. PROGRESS.md Structure\n\nCheck `details.sectionsPresent` and `details.sectionsMissing`:\n- Required sections: Current State, Recent Work, Next Steps\n- If sections are missing, the validation output includes a repair template\n- Block and request the missing sections be added\n\n## 3. Documentation Currency\n\nCheck:\n- `commitsSinceUpdate` - if > 0, documentation may be stale\n- `filesModifiedThisSession` - these should be reflected in PROGRESS.md\n- `uncommittedChanges` - meaningful changes should be committed\n\n## 4. Clean State\n\nIs the project ready for the next session?\n- No half-implemented features\n- Clear next steps documented\n- Any blockers noted\n- If feature work, next work item should be clear\n\nSession context: $ARGUMENTS\n\nRespond with JSON:\n- If all requirements met: {\"decision\": \"approve\", \"reason\": \"Work item verified and documentation complete.\"}\n- If verification failed: {\"decision\": \"block\", \"reason\": \"Work item verification failed: [specific failures]. Fix and re-run verification.\"}\n- If other issues: {\"decision\": \"block\", \"reason\": \"Please address: [specific items]\"}",
"timeout": 60
}
],
"enabled": true,
"priority": 90,
"description": "Evaluate session completion including work item verification results"
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/pre-compact.js",
"timeout": 5,
"description": "Reminds Claude to update PROGRESS.md before context is compacted"
}
],
"enabled": true,
"priority": 80,
"description": "Prompt context update before memory compaction"
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/session-end.js",
"timeout": 10,
"description": "Resumes session for final context update if Stop hook did not complete"
}
],
"enabled": true,
"priority": 100,
"description": "Spawn background context finalization using --resume for continuity"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/track-modification.js",
"timeout": 5,
"description": "Records modification events for context staleness detection",
"suppressOutput": true,
"continueOnError": true
}
],
"enabled": true,
"matcher": "Write|Edit|NotebookEdit",
"priority": 50,
"description": "Track file modifications and mark context as potentially stale"
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/session-start.js",
"timeout": 45,
"description": "Reads PROGRESS.md, feature_list.json, runs smoke tests, outputs context for Claude"
}
],
"enabled": true,
"priority": 100,
"description": "Initialize plugin state and inject current project context including active features"
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Verify this subagent completed its assigned task and documented progress appropriately. If the subagent made code changes, they should be noted for the main session's PROGRESS.md update.\n\nSubagent context: $ARGUMENTS\n\nRespond with JSON: {\"decision\": \"approve\", \"reason\": \"...\"} if task is complete, or {\"decision\": \"block\", \"reason\": \"...\"} if work is incomplete.",
"timeout": 30
}
],
"enabled": true,
"priority": 80,
"description": "Ensure subagents document their work before completing"
}
]
}{
"riskFlags": {
"touchesBash": false,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 2,
"command": 5
},
"eventStats": {
"Stop": 2,
"PreCompact": 1,
"SessionEnd": 1,
"PostToolUse": 1,
"SessionStart": 1,
"SubagentStop": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 5,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}