Defined in hooks/hooks.json
{
"Stop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Before stopping, verify the work is complete:\n\n1. Were all user-requested tasks addressed?\n2. Are there any obvious unfinished items (incomplete code, missing imports, syntax errors)?\n3. If tests were written, do they appear to pass?\n4. Is the todo list up to date with completed items marked?\n\nIf work appears complete, respond: {\"decision\": \"approve\"}\n\nIf there are obvious incomplete items, respond: {\"decision\": \"block\", \"message\": \"Brief description of what seems incomplete\"}",
"timeout": 20
}
],
"matcher": ".*"
}
],
"PreToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "You are validating a file write operation. Briefly check if this change follows good practices:\n\n1. Does it follow project conventions (if CLAUDE.md exists)?\n2. Does it avoid obvious security issues (no secrets, no SQL injection patterns)?\n3. Is the change reasonable for the current task?\n\nIf everything looks fine, respond with just: {\"decision\": \"approve\"}\n\nIf there's a concern, respond with: {\"decision\": \"warn\", \"message\": \"Brief explanation of concern\"}\n\nOnly use \"deny\" for serious security issues: {\"decision\": \"deny\", \"message\": \"Reason\"}",
"timeout": 15
}
],
"matcher": "Write|Edit|MultiEdit"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "You are validating a bash command. Check for safety:\n\n1. Is this a destructive command (rm -rf, drop database, etc.)?\n2. Does it contain obvious security risks?\n3. Is it appropriate for a development workflow?\n\nApprove safe commands: {\"decision\": \"approve\"}\nWarn on risky but possibly intentional: {\"decision\": \"warn\", \"message\": \"Brief concern\"}\nDeny dangerous commands: {\"decision\": \"deny\", \"message\": \"Reason\"}",
"timeout": 10
}
],
"matcher": "Bash"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Analyze the bash command result:\n\n1. Did the command succeed or fail?\n2. If it failed, is this expected or unexpected?\n3. Are there warning signs in the output (deprecation warnings, permission issues, etc.)?\n\nProvide brief analysis in this format:\n{\"status\": \"success|warning|error\", \"summary\": \"One line summary\", \"action\": \"none|retry|investigate\"}",
"timeout": 10
}
],
"matcher": "Bash"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "An agent task has completed. Briefly assess:\n\n1. Did the agent accomplish its goal?\n2. Were there any issues or warnings?\n3. Are follow-up actions needed?\n\nRespond with: {\"completed\": true|false, \"summary\": \"Brief outcome\", \"followUp\": \"none|action needed\"}",
"timeout": 15
}
],
"matcher": "Task"
}
],
"Notification": [
{
"hooks": [
{
"type": "prompt",
"prompt": "A potential issue was detected. Analyze the notification:\n\n1. Is this a test failure, error, or exception?\n2. What's the severity (critical, warning, info)?\n3. Should the user be alerted?\n\nRespond with: {\"severity\": \"critical|warning|info\", \"summary\": \"Brief description\", \"alert\": true|false}",
"timeout": 10
}
],
"matcher": ".*test.*fail.*|.*error.*|.*exception.*"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "A milestone notification was received. Summarize:\n\n{\"type\": \"milestone\", \"summary\": \"Brief description of what completed\"}",
"timeout": 5
}
],
"matcher": ".*build.*complete.*|.*deploy.*success.*"
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
"timeout": 10
}
],
"matcher": ".*"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 7,
"command": 1
},
"eventStats": {
"Stop": 1,
"PreToolUse": 2,
"PostToolUse": 2,
"Notification": 2,
"SessionStart": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 1,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}