Answer: The matcher field filters when hooks fire: values of "*", "", or omitted match all; values containing only letters, digits, _, -, spaces, , and | are treated as exact strings or lists of exact strings; and values containing any other character are evaluated as unanchored JavaScript regular expressions. MCP tools appear as regular tools named mcp____, so to match every tool from a server you must append .* to the server prefix, e.g. mcp__memory__.*. Status: Check failed Entry: tool/claude-code/agents-and-automation/hook-matcher-patterns Revision: 1 Digest: sha256:88979c4b4f5f3924 (changes whenever the content changes) Timeline: Created: 2026-11-17T12:26:37Z Last changed: 2026-11-17T12:26:37Z Last verified: 2026-11-17T12:26:37Z Last attempt: 2026-11-20T12:21:23Z (failed) Next check: 2026-11-20T13:21:23Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of regex matcher | Contains any other character | [1] | 2026-11-17 regex evaluation | RegExp.prototype.test | [1] | 2026-11-17 MCP tool naming pattern | mcp____ | [1] | 2026-11-17 match all server tools | mcp__memory__.* | [1] | 2026-11-17 required suffix | .* | [1] | 2026-11-17 plugin-bundled MCP naming | mcp__plugin____ | [1] | 2026-11-17 Sources: [1] Anthropic. "Hooks reference". https://code.claude.com/docs/en/hooks.md Role: primary. Accessed: 2026-11-17T12:26:37Z Quote: "| Contains any other character | JavaScript regular expression, unanchored |" (Supports: regex matcher) Quote: "A matcher on the regular-expression path is tested with JavaScript's `RegExp.prototype.test`, which succeeds on a match anywhere in the value." (Supports: regex evaluation) Quote: "MCP tools follow the naming pattern `mcp____`, for example:" (Supports: MCP tool naming pattern) Quote: "`mcp__memory__.*` matches all tools from the `memory` server" (Supports: match all server tools) Quote: "To match every tool from a server, append `.*` to the server prefix. The `.*` is required: a matcher like `mcp__memory` or `mcp__brave-search` contains only exact-match characters, so it is compared as an exact string and matches no tool." (Supports: required suffix) Quote: "Tools from a [plugin-bundled MCP server](https://code.claude.com/docs/en/mcp.md#plugin-provided-mcp-servers) use a scoped server segment that includes the plugin name: `mcp__plugin____`." (Supports: plugin-bundled MCP naming) Published: 2026-11-17T03:14:30Z Snapshot SHA-256: a1cc3f82511cfbb06eb9b8641bfb63526d0f2086d87cc338e5d012d14b246abf (captured 2026-11-17T12:26:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-17T12:26:37Z. No independent second source is configured for this entry Last successful check: 2026-11-17T12:26:37Z Last attempt: 2026-11-20T12:21:23Z (failed) Notes and limitations: Extracted automatically from a single official source (section "Matcher patterns"). Related: https://latestn.com/tool/claude-code/agents-and-automation/isolate-subagents-worktrees How do I isolate subagents in separate worktrees in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/load-plugin-in-sdk How do I load a plugin in the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/message-between-sessions-mod How do I send and receive messages between sessions in Claude Code mods? https://latestn.com/tool/claude-code/agents-and-automation/handle-clarifying-questions How do I present Claude Code's clarifying questions and return the user's answers to the SDK? https://latestn.com/tool/claude-code/agents-and-automation/handle-tool-approval-requests How do I handle tool approval requests from Claude Code in my SDK application? https://latestn.com/tool/claude-code/agents-and-automation/hook-exit-codes What exit codes do Claude Code hooks use and what does exit code 2 do? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:16:50Z | check-failed | Extraction did not pass verification: answer contains ` are treated as exact strings or lists of exact strings; and values containing any other character are evaluated as unanchored JavaScript regular expressions. MCP tools appear as regular tools named `, which does not appear in the source | — 2026-11-17T12:26:37Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/hook-matcher-patterns/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/hook-matcher-patterns POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/hook-matcher-patterns with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/hook-matcher-patterns?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do matcher patterns work for Claude Code hooks, including matching MCP tools? Revision 1, last verified 2026-11-17T12:26:37Z. https://latestn.com/tool/claude-code/agents-and-automation/hook-matcher-patterns (accessed 2026-11-21T09:57:47Z). @misc{LatestN_tool_claude_code_agents_and_automation_hook_matcher_patterns_r1, title = {How do matcher patterns work for Claude Code hooks, including matching MCP tools?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/hook-matcher-patterns}}, note = {Revision 1; digest sha256:88979c4b4f5f3924; last verified 2026-11-17T12:26:37Z; accessed 2026-11-21T09:57:47Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/hook-matcher-patterns