[DOCS] Documentation incorrectly limits `matcher` field scope in Hooks Configuration
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/hooks
Section/Topic
The Configuration > Structure section of the Hooks reference.
Current Documentation
Under the Structure section, the documentation defines the matcher field as follows:
* matcher: Pattern to match tool names, case-sensitive (only applicable forPreToolUse,PermissionRequest, andPostToolUse)
What's Wrong or Missing?
The documentation explicitly states that the matcher field is only applicable for PreToolUse, PermissionRequest, and PostToolUse.
However, this contradicts later sections of the same document which demonstrate that matcher is also used for:
- Notification hooks (to filter by notification type).
- SubagentStart and SubagentStop hooks (to target specific agent types by name).
The current definition forces a user to believe matcher cannot be used for these other event types, despite examples lower on the page showing otherwise.
Suggested Improvement
The definition of matcher should be updated to reflect all supported event types.
Suggested text:
* matcher: Pattern to match tool names, notification types, or agent names (applicable forPreToolUse,PermissionRequest,PostToolUse,Notification,SubagentStart, andSubagentStop).
Impact
High - Prevents users from using a feature
Additional Context
Contradictory examples found in the same document:
- Under the Notification section:
``json``
{
"matcher": "permission_prompt",
"hooks": [...]
}
- Under the Project-level hooks for subagent events section:
``json``
"SubagentStart": [
{
"matcher": "db-agent",
"hooks": [...]
}
]
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗