Mammoth Templates logomammoth templates

Home / Claude Code / Hooks & Workflows

Video preview

Hooks are where Claude Code stops being a clever assistant and becomes a dependable teammate: deterministic code that runs on every edit, every shell command and every time Claude says it is finished. This pack gives you 15 production-minded hook recipes as dependency-free Python scripts that run the same on Windows, macOS and Linux - each with a copy-paste settings.json snippet and notes on exactly which hook event, matcher and exit code it uses.

Guardrails: block dangerous shell commands, protect sensitive and generated files, scan writes for secrets, enforce conventional commits, restrict network hosts, and guard prompts. Quality gates: format on edit, lint feedback that Claude can act on, run tests when Claude tries to stop, remind about docs. Visibility: desktop notifications, an append-only JSONL audit log, session context injection, and snapshots before compaction.

A bundled self-test (tests/test_hooks.py) feeds sample events to every script so you can verify them on your machine in seconds.

Six end-to-end workflow playbooks (feature, bugfix, refactor, release, onboarding, code review) show how to combine hooks, subagents, slash commands and plan mode into repeatable loops with verification gates. This is the Pro pack: deeper, more opinionated, and built to be adapted by teams.

Highlights

  • 15 hook scripts: pure Python 3, no dependencies, Windows/macOS/Linux
  • Every recipe has a settings.json snippet and the exact event/matcher/exit-code contract
  • Self-test harness included - run it before trusting any hook
  • Security guardrails: dangerous commands, secrets, protected paths, network allowlist
  • Quality gates: format, lint feedback, test-on-stop, docs reminder
  • 6 workflow playbooks tying hooks, subagents and commands together