protect-main-branch
claudePrevent git operations that would modify the main branch (or configured branches) in Claude Code. Individual subcommands can be opted out via PROTECT_MAIN_BRANCH_ALLOWED_SUBCOMMANDS, or the hook can be turned off entirely for the current scope via PROTECT_MAIN_BRANCH_DISABLE.
hooks