Back to All HooksPreToolUsePreToolUsePreToolUse
Safety Hooks for Claude Code
3 hooks tagged with “safety”
Branch Protection
Prevents direct file edits when on protected branches like main or production
gitbranchprotectionsafety
Safe Command Auto-Approval
Auto-approves safe bash commands like ls and git status while blocking destructive operations like rm -rf and git push --force
safetypermissionsautomationbash
File Size Guard
Prevents writing excessively large files that could bloat the repository, with configurable size limits per file type
safetyfile-sizerepositoryguard
Browse more topics
audioautomationbashbranchbritishbuildbundle-sizecicode-qualitycommitconventional-commitsdefenseenforcementeslintfeedbackfile-sizeformatformattinggitguardimportslintlintinglocalizationmacosnotificationoptimizationorganizationperformancepermissionsprettierpreventionproductivityprompt-injectionprotectionqualityrepositorysafetyscanningsecretssecurityspellingtddtestingtexttypescript