# Hooks reference

> Reference for the Hooks area in Delegate and Cartographer — running a shell command at a specific point in the agent's lifecycle.

A hook runs a shell command at a specific point in the agent's lifecycle. Hooks are managed from **Add-ons & Integrations** → **Hooks**, via **Add hook**.

| Field | Description |
|---|---|
| **Event type** | When the hook runs: Session start, User prompt submitted, Before tool, Permission request, Permission resolved, After tool, After tool failure, or Agent stop. |
| **Name** | A short label for the hook (for example, "Block file deletion"). |
| **Tool** | Which tool the hook applies to. Defaults to All tools. |
| **Shell command** | The command to run. Runs via `cmd.exe`. To deny a tool, exit with code 2 (for example, `exit /b 2`). |
