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)
python3 -m pip install git+https://github.com/basitalisandhu/cc-hooks # the library, for the python3 that runs your hooks
From the README; see the full README for every option.
Links
Releases
More in Security tooling
- agent-off-switch: Find every AI agent identity in Microsoft 365, AWS and GitHub, see what it can reach, and switch it off. Offline on saved exports.
- skill-scan-gate: CI gate for Claude Code skills and plugins, with SARIF output. GitHub Action and CLI.
- agent-threat-model: Threat modeling for AI agents: describe the system in YAML, get a STRIDE and OWASP Agentic threat model.
- agent-config-audit: Audit AI agent configuration files for security risks.
- agentic-semgrep-rules: Semgrep rules for AI agent code in Python, TypeScript and JavaScript.
- security-actions: GitHub Actions for AI agent and supply chain security checks.
- cc-plugin-lock: Lock file for Claude Code plugins: pins plugins and skills to content hashes and verifies them before load.
- claude-perm-sim: Claude Code permission rule simulator: shows which rule decides a tool call and where a rule set is permissive.
- llms-txt-gen: Generate llms.txt for any docs site or repository.
- scp-guardrails: Build AWS service control policies from a short spec and lint them for lockouts and statements that deny nothing.
- spotlighting: Spotlighting for prompt injection defence in Python: mark untrusted text before it reaches a model.
- llm-agent-control-plane: Deterministic policy enforcement for LLM agents.
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