Hooks

Shell scripts that run automatically before or after Claude Code uses a tool. Use hooks to auto-format code, enforce linting, block risky file edits, run tests, or send notifications — all without manual intervention. Supports PreToolUse, PostToolUse, Notification, and Stop events. Each hook below includes a ready-to-use script and configuration.

Lint on Edit
PostToolUse
Automatically run ESLint on files after Claude Code edits them
lintingeslintcode-quality
Format on Save
PostToolUse
Run Prettier to format files after Claude Code writes or edits them
formattingprettiercode-quality
Desktop Notification
Stop
Send a desktop notification when Claude Code finishes a task
notificationproductivitymacos
TDD Guard
PreToolUse
Hooks-driven system that monitors file operations and blocks changes that violate TDD principles
tddtestingqualityenforcement
Claudio Sound Effects
Notification
Adds delightful OS-native sounds to Claude Code events for audio feedback during tasks
audionotificationfeedbackproductivity
Britfix
PostToolUse
Converts American English to British English in Claude Code output, with context-awareness for code files
localizationbritishspellingtext
TypeScript Quality Check
PostToolUse
Quality check hook for TypeScript projects that runs compilation, linting, and formatting validation
typescriptqualitylintformat
Auto Test Runner
PostToolUse
Automatically runs relevant tests after code edits to catch regressions immediately
testingautomationciquality
Secret Scanner
PreToolUse
Scans files for accidentally committed secrets, API keys, and credentials before they are written
securitysecretsscanningprevention
Branch Protection
PreToolUse
Prevents direct file edits when on protected branches like main or production
gitbranchprotectionsafety
Commit Message Linter
PreToolUse
Validates that commit messages follow conventional commit format before allowing commits
gitcommitlintingconventional-commits
Auto Import Sort
PostToolUse
Automatically sorts and organizes imports after file edits using the project's import ordering rules
importsformattingorganizationeslint
Bundle Size Monitor
PostToolUse
Monitors JavaScript bundle size after builds and warns when the bundle exceeds size thresholds
performancebundle-sizeoptimizationbuild
Prompt Injection Defense
PostToolUse
Scans tool outputs for prompt injection patterns including instruction overrides, role-playing attempts, and encoding obfuscation
securityprompt-injectiondefensescanning
Safe Command Auto-Approval
PreToolUse
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
PreToolUse
Prevents writing excessively large files that could bloat the repository, with configurable size limits per file type
safetyfile-sizerepositoryguard
Auto Changelog
PostToolUse
Automatically appends entries to CHANGELOG.md when Claude commits code, capturing the date and commit message
changelogdocumentationgitautomation
Dead Code Detector
PostToolUse
Checks for unused exports after file edits and warns about potentially dead code
dead-codecleanupqualitymaintenance
Test Coverage Guard
PostToolUse
Checks test coverage after edits and warns if coverage drops below the configured threshold
testingcoveragequalityguard
Auto PR Description
PreToolUse
Automatically generates a pull request description from commit messages and changed files when creating a PR
gitprautomationgithub
Environment Variable Leak Detector
PostToolUse
Scans files after edits for hardcoded secrets, API keys, and tokens that should be in environment variables
securitysecretsenvironment-variablesapi-keys+1