Defined in hooks/hooks.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Before writing or editing files, ensure you've read the existing content first to understand the context and avoid unintended changes."
}
],
"matcher": "Write|Edit"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "When using Bash commands, verify that the command is safe and necessary. Prefer using specialized tools (Read, Edit, Write, Grep, Glob) over bash commands for file operations."
}
],
"matcher": "Bash"
}
],
"PostToolUse": [
{
"hooks": [
{
"args": [
"${TOOL_NAME}",
"${TOOL_INPUT}"
],
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/example-hook.sh",
"timeout": 10
}
],
"matcher": "Bash"
}
],
"SessionStart": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Session started with starter-plugin loaded. Example hooks are active for PreToolUse and PostToolUse events."
}
],
"matcher": "*"
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "prompt",
"prompt": "User prompt received. Remember to follow best practices and use appropriate tools for each task."
}
],
"matcher": "*"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 4,
"command": 1
},
"eventStats": {
"PreToolUse": 2,
"PostToolUse": 1,
"SessionStart": 1,
"UserPromptSubmit": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 1,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}