ClaudeSuperPower
P

PreToolUse (__exec$)

Hook

PostHog LLM Analytics + permission gating for write commands via mcp__posthog__exec

Fires on

PreToolUsematching__exec$

Immediately before a tool runs — this is where an action can be denied.

Where this sits in a session

  1. Session start
  2. Prompt submitted
  3. Prompt expansion
  4. Before tool use
  5. After tool use
  6. Notification
  7. Before compaction
  8. Subagent finished
  9. Turn finished
  10. Session end

Behaviour unclearWe could not tell from the script whether this hook can block. Read it before installing.

What it runs

Executed automatically when the event fires — no prompt, no confirmation.

command· timeout 5s
${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT}/hooks/gate-exec-write.sh

Install it yourself

Paste into .claude/settings.json to run this hook without installing the whole plugin. Adjust the paths to point at your own copy of the scripts.

settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT}/hooks/gate-exec-write.sh",
            "timeout": 5
          }
        ],
        "matcher": "__exec$"
      }
    ]
  }
}

Shipped by 1 plugin

Installing any of these installs this hook.

Reviews

Log in to leave a review.

No reviews yet — be the first.

Explore related

Other things in this space — across every part of the ecosystem, not just hooks.