Skip to content
Development
Hook

Hooks

What posthog runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

Install
$ npx -y skills add PostHog/ai-plugin --agent claude-code

Ships with posthog. Installing the plugin gets these hooks.

What fires, and when

SessionEnd

  • Runs session-end-llma.py.

PreToolUse

  • Runs gate-exec-write.sh.
Read hooks/hooks.json

Where it lives

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

Ships withposthog

Official PostHog plugin for AI clients. Access PostHog products directly from your AI coding tool.

Get the whole plugin, auto-invoked