Skip to content

Claude Hook Policy Simulator

Simulate Claude hook decisions for pre/post tool events and validate policy rule coverage before rollout

Claude Hook Policy Simulator

3 events: 1 allow, 1 deny, 1 ask

Updated . Provided as is. Check the output before you rely on it in production.

How to use Claude Hook Policy Simulator

  1. 1

    Define default action and rules

    Paste JSON with defaultAction and ordered hook rules. Each rule can match by phase, tool, and optional command substring.

  2. 2

    Add representative hook events

    Include realistic pre and post tool events from your workflow so the simulation reflects real runtime conditions.

  3. 3

    Run policy simulation

    Execute Run Hook Simulation to evaluate each event against rule order and observe final allow, deny, or ask actions.

  4. 4

    Refine rules before production rollout

    Use decision summaries and unmatched cases to tighten policy logic, then repeat simulation until outcomes match your governance requirements.

Questions and answers

What is Claude Hook Policy Simulator?
Claude Code hooks run checks before (pre) or after (post) a tool call and can allow it, deny it or ask for approval. This simulator replays sample events against ordered rules matching phase, tool and command text, applies the first match or your default action, and counts the resulting decisions.
How do I model hook rules?
Define a default action and add ordered rules with phase, tool matcher, optional command text matcher, and target action. Then include sample events to simulate real runtime behavior.
Does it support wildcard policies?
Yes. You can use wildcard values for phase or tool to model broad policy fallbacks and then layer specific exceptions above them.
Does Claude Hook Policy Simulator store or send my data?
No. Simulation runs entirely in the browser and your policy payload stays local.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/claude-hook-policy-simulator/

For automation planning, fetch the canonical contract at /api/tool/claude-hook-policy-simulator.json.