Hooks — lifecycle triggers for AI coding tools

Browse 6 published hooks on Shared Context. Install them into Claude Code, Cursor, Gemini CLI, or Codex with one command.

What is a hook?

A hook is a shell command the AI tool runs automatically when something happens — before a tool call, after a file edit, before the model responds, when a session starts. Hooks are how teams enforce local conventions without asking the model to remember them.

Typical uses

Auto-formatting on write, linting after edit, blocking commits that skip tests, pinging a Slack channel on session start, checking that sensitive files aren’t touched. Hooks run with your shell’s permissions; only install from sources you trust.

Portability

Claude Code has the most mature hook system today; Gemini CLI and Cursor are catching up. Shared Context stores each hook as a `hook.json` file and installs it to the right location for every platform that supports it.

Read the full guide →

Popular hooks