Defined in .claude/settings.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'root/master'; then echo '{\"decision\": \"block\", \"reason\": \"Direct edits to root/master/ are not allowed. Create a worktree in worktree/ folder instead using /wt-new command.\"}'; exit 2; fi"
}
],
"matcher": "Bash"
},
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'root/master'; then echo '{\"decision\": \"block\", \"reason\": \"Direct edits to root/master/ are not allowed. Create a worktree in worktree/ folder instead using /wt-new command.\"}'; exit 2; fi"
}
],
"matcher": "Edit"
},
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'root/master'; then echo '{\"decision\": \"block\", \"reason\": \"Direct edits to root/master/ are not allowed. Create a worktree in worktree/ folder instead using /wt-new command.\"}'; exit 2; fi"
}
],
"matcher": "Write"
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_USER_PROMPT\" | grep -qi 'commit\\|push\\|merge'; then echo 'Reminder: Use /wt-pr to create PRs from worktree branches.'; fi; exit 0"
}
],
"matcher": "*"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"command": 4
},
"eventStats": {
"PreToolUse": 3,
"UserPromptSubmit": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 4
}
}