cc-hooks
Typed Python SDK and offline test runner for Claude Code hooks.
What it is
One frozen dataclass per documented hook event, decision builders that print exactly the JSON and exit codes the hooks reference documents, and a cc-hooks command that tells you which handlers would run for a payload, replays recorded payloads through them without side effects, and records real payloads as fixtures. Standard library only, Python 3.11 or newer.
Install
pipx install git+https://github.com/basitalisandhu/cc-hooks # the cc-hooks command (see "Install" for the library side)
From the README; see the full README for every option.
Links
Releases
Topics: agent-security, agentic-ai, ai-agents, claude-code, claude-code-hooks, cli, developer-tools, dry-run, fixtures, guardrails, hacktoberfest, hooks, llm-security, python, sdk, settings, testing, typed