Defined in hooks/hooks.json
{
"Stop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Before stopping, verify the RPI methodology was followed appropriately for this task:\n\n1. If this was a complex task (5+ files, unfamiliar code, or unclear approach):\n - Was research conducted first?\n - Was a plan created before implementation?\n - Were changes verified?\n\n2. If implementation was done:\n - Were automated checks run (tests, lint, build)?\n - Are there any unverified changes?\n\n3. Context health:\n - Is context utilization healthy (<60%)?\n - Should a compaction checkpoint be suggested?\n\nIf the workflow was appropriate for the task size, return 'approve'.\nIf critical steps were skipped for a complex task, return 'block' with a reminder of what should be done.\nFor simple tasks, always approve - RPI is optional for small changes.",
"timeout": 30
}
],
"matcher": "*"
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash $CLAUDE_PLUGIN_ROOT/scripts/init-harness.sh",
"timeout": 5
}
],
"matcher": "*"
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Analyze this user prompt and recommend the appropriate harness workflow tier.\n\n## Workflow Tiers\n\n**Trivial** (1-2 files, obvious fix):\n- Implement directly\n- Document briefly in `.harness/scratch/`\n- No planning phase needed\n\n**Small** (3-4 files, clear approach):\n- Use `/harness:plan <feature>` before implementing\n- Skip research if approach is obvious\n- Document in `.harness/thoughts/plans/`\n\n**Complex** (5+ files, unfamiliar code, unclear approach):\n- Full RPI: `/harness:research` → `/harness:plan` → `/harness:implement`\n- This project uses harness instead of Claude Code's built-in EnterPlanMode\n- Document in `.harness/thoughts/research/` and `.harness/thoughts/plans/`\n\n## Your Task\n\n1. Assess the task complexity from the user's prompt\n2. If **trivial**: Return empty (no guidance needed, but remind to note work in scratch/)\n3. If **small**: Suggest `/harness:plan <feature>` briefly\n4. If **complex**: Recommend full RPI workflow with specific commands\n5. If user is asking a question or already using harness commands: Return empty\n\n**Key principle:** Even trivial work should be documented. Projects evolve—today's quick fix becomes tomorrow's feature.\n\n**Critical:** Do NOT suggest using Claude Code's built-in EnterPlanMode. This project uses harness for all planning.\n\nReturn a concise recommendation (1-2 sentences) or empty response if no guidance needed.",
"timeout": 20
}
],
"matcher": "*"
}
]
}{
"riskFlags": {
"touchesBash": false,
"matchAllTools": false,
"touchesFileWrites": false
},
"typeStats": {
"prompt": 2,
"command": 1
},
"eventStats": {
"Stop": 1,
"SessionStart": 1,
"UserPromptSubmit": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}