H2Harnessscope: coreweight: 1fix: manual
H2: PreToolUse hooks have matcher
Why this rule exists (Empirical Evidence)
Corpus analysis: 248/273 (91%) PreToolUse hooks lack tool_name filtering (no matcher field). Every Read, Glob, Grep call triggers the hook — massive performance tax on routine operations.
Claude Code Repository Corpus Analysis (2026)
Anti-pattern (Triggers H2)
# Anti-pattern triggering H2 (PreToolUse hooks have matcher) # Rule or repository configuration violates this check without verification.
Compliant pattern (Passes H2)
# Compliant harness passing H2 (PreToolUse hooks have matcher) # Concrete, verifiable repository configuration backed by corpus-4533.
Verify locally or online
npm install -g agentlint-ai && agentlint check --check H2