matcher_patterns
Whether hooks can filter which tools or events they respond to using name matching, regex patterns, or structured criteria.
Type: bool Content type: hooks
Provider Support
Section titled “Provider Support”| Provider | Supported | Mechanism |
|---|---|---|
| amp | ✓ | Amp hooks filter firing via 'input.contains' — exact literal substring match against tool input |
| claude-code | ✓ | hook_matcher_patterns: exact string, pipe-separated list, or JavaScript regex; matches on tool_name or event-specific fields; if field uses permission-rule syntax for per-subcommand filtering |
| codex | ✓ | hook_matcher: Codex hooks support pattern matching to filter which tools or events trigger the hook |
| crush | ✓ | HookConfig has a matcher field: a regex pattern tested against the tool name. An empty matcher matches all tools. |
| cursor | ✓ | Hook entries accept a matcher string that filters which tool or event fires the hook (for example a specific shell command or tool name). |
| factory-droid | ✓ | PreToolUse and PostToolUse hooks use matcher strings supporting exact tool names, regex patterns (Edit|Create, Notebook.*), MCP tool patterns (mcp__<server>__<tool>), and wildcard (*) to match all tools |
| gemini-cli | ✓ | hook_matchers: Gemini CLI hooks support event and tool name matching to filter when hooks fire |
| cline | ✗ | Cline hooks fire on configured lifecycle events; no per-tool pattern matching documented |
| copilot-cli | ✗ | Copilot CLI hooks fire on all events of their configured type; no per-tool filtering documented |
| kiro | ✗ | Kiro hooks fire on configured lifecycle events; no per-tool name filtering or regex matching documented |
| opencode | ✗ | not documented |
| pi | ✗ | Pi hooks fire on configured lifecycle events; no per-tool name filtering at the subscription level — tool discrimination is done in handler code |
| roo-code | ✗ | not documented |
| windsurf | ✗ | Windsurf hooks fire on all events of their configured type; no per-tool or regex matching documented |
| zed | ✗ | not documented |