> ## Documentation Index
> Fetch the complete documentation index at: https://si.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HookEventName

> Represents the hook event names that Claude Code can trigger.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

**Namespace:** CloudNimble.ClaudeEssentials.Hooks

**Inheritance:** System.Enum

## Syntax

```csharp theme={"dark"}
CloudNimble.ClaudeEssentials.Hooks.HookEventName
```

## Summary

Represents the hook event names that Claude Code can trigger.

## Values

| Name | Value | Description |
| - | - | - |
| `PreToolUse` | 0 | Runs before a tool executes. |
| `PostToolUse` | 1 | Runs after a tool completes successfully. |
| `PostToolUseFailure` | 2 | Runs after a tool fails. |
| `PostToolBatch` | 3 | Runs once after every tool call in a batch has resolved, before the next model request. |
| `Notification` | 4 | Runs when Claude Code sends a notification. |
| `UserPromptSubmit` | 5 | Runs when the user submits a prompt. |
| `UserPromptExpansion` | 6 | Runs when a slash command or MCP prompt expands into a prompt. |
| `SessionStart` | 7 | Runs when a session starts or resumes. |
| `SessionEnd` | 8 | Runs when a session ends. |
| `Stop` | 9 | Runs when the main agent finishes responding. |
| `StopFailure` | 10 | Runs when a turn ends because of an API error. |
| `SubagentStart` | 11 | Runs when a subagent starts. |
| `SubagentStop` | 12 | Runs when a subagent finishes. |
| `PreCompact` | 13 | Runs before context compaction. |
| `PostCompact` | 14 | Runs after context compaction. |
| `PreModelSwitch` | 15 | Runs before the session switches models. |
| `PostModelSwitch` | 16 | Runs after the session switches models. |
| `PermissionRequest` | 17 | Runs when a permission dialog would be shown. |
| `PermissionDenied` | 18 | Runs when a tool call is denied. |
| `Setup` | 19 | Runs during repository setup or maintenance. |
| `TeammateIdle` | 20 | Runs when a teammate is about to go idle. |
| `TaskCreated` | 21 | Runs when a task is created. |
| `TaskCompleted` | 22 | Runs when a task is completed. |
| `Elicitation` | 23 | Runs when an MCP server requests user input. |
| `ElicitationResult` | 24 | Runs after the user responds to an MCP elicitation, before the response is sent. |
| `ConfigChange` | 25 | Runs when a configuration file changes during a session. |
| `WorktreeCreate` | 26 | Runs when a worktree is created. |
| `WorktreeRemove` | 27 | Runs when a worktree is removed. |
| `InstructionsLoaded` | 28 | Runs when a CLAUDE.md or rules file is loaded into context. |
| `CwdChanged` | 29 | Runs when the working directory changes. |
| `FileChanged` | 30 | Runs when a watched file changes. |
| `DirectoryAdded` | 31 | Runs when a directory is added to the session. |
| `MessageDisplay` | 32 | Runs as assistant message text is displayed. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.