Defined in hooks/hooks.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "npx tsx ${CLAUDE_PROJECT_DIR}/shared/hooks/log-task-call.ts",
"description": "Logs Task tool calls before agent execution. Saves context for later retrieval in SubagentStop hooks."
}
],
"matcher": "Task"
},
{
"hooks": [
{
"type": "command",
"command": "npx tsx ${CLAUDE_PROJECT_DIR}/shared/hooks/validate-folder-structure-write.ts",
"matcher": "Write",
"description": "Validates folder structure when creating .claude configuration files. Ensures proper directory organization for agents, hooks, skills, and rules."
},
{
"type": "command",
"command": "npx tsx ${CLAUDE_PROJECT_DIR}/shared/hooks/validate-rules-file.ts",
"matcher": "Write|Edit",
"description": "Validates rule file structure and frontmatter. Ensures rules have proper Required Skills metadata and valid YAML frontmatter."
}
],
"matcher": "Write|Edit"
},
{
"hooks": [
{
"type": "command",
"command": "npx tsx ${CLAUDE_PROJECT_DIR}/shared/hooks/validate-folder-structure-mkdir.ts",
"description": "Validates mkdir commands for .claude directories. Prevents creation of invalid or non-standard directory structures."
}
],
"matcher": "Bash"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "npx tsx ${CLAUDE_PROJECT_DIR}/shared/hooks/log-task-result.ts",
"description": "Logs Task tool results after agent completion. Captures agent output and context for analysis."
}
],
"matcher": "Task"
},
{
"hooks": [
{
"type": "command",
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/add-folder-context.ts",
"description": "Discovers and adds CLAUDE.md context when reading files. Automatically enriches Claude's context with folder-level documentation."
}
],
"matcher": "Read"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"command": 6
},
"eventStats": {
"PreToolUse": 4,
"PostToolUse": 2
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 1,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 6
}
}