[DOCS] Documentation incorrectly limits `matcher` field scope in Hooks Configuration

Resolved 💬 3 comments Opened Jan 22, 2026 by coygeek Closed Feb 1, 2026

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 for PreToolUse, PermissionRequest, and PostToolUse)

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:

  1. Notification hooks (to filter by notification type).
  2. 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 for PreToolUse, PermissionRequest, PostToolUse, Notification, SubagentStart, and SubagentStop).

Impact

High - Prevents users from using a feature

Additional Context

Contradictory examples found in the same document:

  1. Under the Notification section:

``json
{
"matcher": "permission_prompt",
"hooks": [...]
}
``

  1. Under the Project-level hooks for subagent events section:

``json
"SubagentStart": [
{
"matcher": "db-agent",
"hooks": [...]
}
]
``

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗