PulseAugur
EN
LIVE 21:27:52

Claude Code hook matching fails on exact server prefix, documentation mismatch found

A technical deep-dive reveals a significant discrepancy in how Claude Code handles tool matching for hooks. While documentation and permission rules suggest that a server prefix like 'mcp__lab' should match all tools from that server, testing showed this exact string failed to trigger any hooks in 42 attempts. Conversely, 'mcp__lab__.*' consistently matched all tools, aligning with documentation for wildcard usage. The article details experiments with Claude Code 2.1.289, highlighting how different string formats (exact match, regular expression, permission rule syntax) lead to unexpected behavior and potential confusion for developers using Claude's hook system. AI

IMPACT Highlights potential developer confusion and debugging challenges with Claude Code's hook and tool matching system.

RANK_REASON The article details a specific functional issue and documentation mismatch within a particular AI coding tool, rather than a broader model release or research finding.

Read on dev.to — MCP tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

Claude Code hook matching fails on exact server prefix, documentation mismatch found

How we ranked this

Signal score
2 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
The article details a specific functional issue and documentation mismatch within a particular AI coding tool, rather than a broader model release or research finding.
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
product, other
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
Same-day
Cluster formed today. Ranking reflects the current source set at time of score.

Full methodology in our editorial standards.

COVERAGE [1]

  1. dev.to — MCP tag TIER_1 English(EN) · Rulestack ·

    Claude Code's hook matcher mcp__lab fired 0 times in 42 calls, though the same string worked as a permission rule

    <blockquote> <p>Across 14 headless runs of Claude Code 2.1.289, a hook whose matcher was the server prefix <code>mcp__lab</code> fired 0 times in 42 calls to that server's tools, while <code>mcp__lab__.*</code> fired 42 of 42, and the same bare <code>mcp__lab</code> passed to <co…