Add a guard script that blocks git commit/push on protected branches (develop, main, master) via a PreToolUse hook. Update CLAUDE.md with stricter branching rules: one commit per task, immediate commits on feature branches, no direct commits to protected branches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
478 B
JSON
22 lines
478 B
JSON
{
|
|
"hooks": {
|
|
"SessionStart": [
|
|
{ "hooks": [{ "type": "command", "command": "beans prime" }] }
|
|
],
|
|
"PreCompact": [
|
|
{ "hooks": [{ "type": "command", "command": "beans prime" }] }
|
|
],
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": ".claude/guard-branch.sh",
|
|
"statusMessage": "Checking branch protection..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |