A hook runs your code at a fixed point in a Claude Code session, and exit code 2 stops the action cold. This kit gives you eight hooks that work today, a plugin that bundles them, and 22 tests that prove each one. Built against the Claude Code hooks and plugin documentation as of October 2026.
What You Get
- Secret guard (PreToolUse). Denies any Write, Edit or MultiEdit that contains an AWS, Anthropic, GitHub, Stripe, Razorpay or Slack key, a private key block, or that targets a .env file.
- Auto-formatter (PostToolUse). Runs Biome, Prettier, Ruff, Black, gofmt, rustfmt or shfmt depending on file type, and skips quietly when none is installed.
- Session summary logger (Stop). Appends the final message of every turn to a dated file in .claude/session-log and respects stop_hook_active so it cannot loop.
- Context loader (SessionStart). Prints branch, upstream, last five commits, dirty files and the head of TODO.md into context on startup, resume and compact.
- Rule injector (UserPromptSubmit). Adds project rules from a JSON file when your prompt mentions deploys, migrations or any keyword you define.
- Telegram notifier (Notification). Sends permission and idle prompts to your phone. Standard library only, and it never prints the token.
- Push gate (PreToolUse). Runs your build before any git push and blocks the push with the last 40 lines of output if it fails. A plain git pre-push version is included.
- Dangerous-command blocker (PreToolUse). Stops rm -rf on root or home, force-push to main, git reset --hard, DROP TABLE, --no-verify, curl piped to a shell and seven more patterns.
- Plugin manifest and marketplace file. plugin.json, marketplace.json and hooks.json wired with CLAUDE_PLUGIN_ROOT, ready to push to GitHub.
- Three skills. hook-doctor for debugging silent hooks, session-handoff for resumable sessions, and pre-merge-review for a diff checklist.
- 22 automated tests. Standard-library tests that feed sample payloads to every script and check exit codes and JSON output.
- Install and troubleshooting guides. Three install routes, Telegram setup, and fixes for hooks that never run, run twice or crash without blocking.
How to Use
- Run install.sh to copy the scripts into your hooks folder.
- Merge the hooks object from settings.example.json into settings.json, or install the plugin folder from GitHub.
- Run python3 tests/run_tests.py and confirm 22 tests pass.
- Restart Claude Code and open /hooks to see all entries.
- Ask Claude to write a fake AWS key into a file and watch the secret guard deny it.
- Tune the blocker patterns, prompt rules and push command to match your repo.
Who This Is For
- Developers who run Claude Code daily and want guardrails that do not depend on the model remembering a rule.
- Team leads who need one committed settings file that protects every contributor.
- Plugin authors who want a working manifest, marketplace file and hooks.json to copy.
- Solo founders who want phone alerts when an agent waits for approval.
Every script is plain Python or bash with no dependencies, so you can read one in two minutes and change it in five. Browse more in the Claude Code configs collection, or try Prompt Bloat Analyzer.