An agent on main can push straight to it when the server does not protect the branch. The git plugin now ships a Claude Code hook that refuses such a push before it runs. It fails open, does nothing on other runtimes, and has an opt-out read only from the hook's own environment. Closes: #178 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
17 lines
282 B
JSON
17 lines
282 B
JSON
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"command": "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/refuse-push-to-main.py",
|
|
"timeout": 10,
|
|
"type": "command"
|
|
}
|
|
],
|
|
"matcher": "Bash"
|
|
}
|
|
]
|
|
}
|
|
}
|