Quartet / Quintet

Claude Code Hook Events — Where matcher and if Actually Apply

The official documentation lists the events, what each matcher matches, and where if applies in separate places. What you need while writing a config is one table you can scan, so here it is.

Events and matchers

EventWhat the matcher is tested againstExample values
PreToolUsetool nameEdit|Write, Bash, mcp__server__.*
PostToolUsetool nameEdit|Write, Bash
PostToolUseFailuretool nameBash
PermissionRequesttool nameBash
PermissionDeniedtool nameBash
SessionStarthow the session startedstartup, resume, clear, compact, fork
Setupwhich CLI flag triggered setupinit, maintenance
SessionEndwhy the session endedclear, resume, logout, prompt_input_exit, other
Notificationnotification typepermission_prompt, idle_prompt, auth_success, agent_completed
SubagentStartagent typegeneral-purpose, Explore, Plan, custom names
SubagentStopagent typesame as SubagentStart
PreCompactwhat triggered compactionmanual, auto
PostCompactwhat triggered compactionmanual, auto
PreModelSwitchcanonical name of the target modelclaude-opus-5, .*opus.*
PostModelSwitchcanonical name of the target modelclaude-opus-5
ConfigChangeconfiguration sourceuser_settings, project_settings, local_settings, policy_settings, skills
DirectoryAddedhow the directory was addedslash_command, register_repo_root
FileChangedliteral filenames to watch.envrc|.env
StopFailureerror typerate_limit, overloaded, authentication_failed, server_error
InstructionsLoadedload reasonsession_start, nested_traversal, path_glob_match, include, compact
UserPromptExpansioncommand nameyour skill or command names
ElicitationMCP server nameyour configured MCP server names
ElicitationResultMCP server namesame as Elicitation

Events that silently discard a matcher

The documentation states it outright: “If you add a matcher field to an event without matcher support, it is silently ignored.”
No error appears. The handler you thought was narrowed runs every time.

CwdChanged, UserPromptSubmit, PostToolBatch, Stop, TeammateIdle, TaskCreated, TaskCompleted, WorktreeCreate, WorktreeRemove, MessageDisplay

Events where if is evaluated

if matches the tool name and its arguments together, and it is only evaluated on the five tool events. Written anywhere else, that handler never runs.

PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied

Required handler fields

Each type requires different fields. The old field surviving a type change is the common shape.

typeRequired
commandcommand
httpurl
mcp_toolserver, tool
promptprompt
agentprompt

Source: Hooks, as of 2026-09-04. This table is compiled from that documentation and is not the documentation itself. Where they disagree, the official page is correct.

There is an MIT tool that checks exactly this. It reads .claude/ and reports the settings that are ignored and the deprecated spellings, citing the documentation behind each finding.

ccheck