Skip to content

Rule Reference

SEC383lintai-ai-securitycompatqualitypreviewclaude_settingswarn

Claude settings: missing `matcher` on matcher-capable hook event

Claude settings should set `matcher` on matcher-capable hook events

Public lane
compat
Category
quality
Provider
lintai-ai-security
Scope
per-file
Surface
claude_settings
Tier
preview
Severity
warn
Confidence
high
Detection
structural
Remediation
message only
How to read this lane

Config, schema, and policy contract review.

How to read this category

Contract, schema, or config correctness signal.

Activation Model

Preset Activation

These presets explain where this rule appears in the product experience.

Lifecycle

Stable Lifecycle Contract

State

stable

Graduation rationale

Checks shared committed Claude settings for exact omission of `matcher` on matcher-capable hook events.

Deterministic signal basis

ClaudeSettingsSignals exact hook-event and matcher absence detection in parsed Claude settings JSON.

Malicious corpus
claude-settings-missing-required-matcher
Benign corpus
claude-settings-required-matcher-present-safe
structured evidence required remediation reviewed
Canonical note

Structural preview rule; deterministic today, but the preview contract may still evolve.

Nearby Signals

Related Rules

SEC383 / CLAUDE-HOOK-MISSING-MATCHER

SEC383 flags shared Claude settings when a matcher-capable hook event such as PreToolUse or PostToolUse omits matcher entirely.

Why It Matters

This is a quiet scope bug. Reviewers often expect PreToolUse and PostToolUse hooks to be explicitly scoped to the relevant tools. When matcher is omitted, the shared config can look intentionally targeted while actually behaving more broadly than expected.

Positioning

This is a compat rule, not a headline security finding. The issue is scoped-config correctness and review clarity, so it belongs in the compatibility lane.

Trigger Shape

The rule triggers only when all of these are true:

  • the file is a detected Claude settings surface
  • the path is not fixture-like
  • a PreToolUse or PostToolUse hook entry contains hooks
  • that same entry omits matcher

Clean Cases

These stay clean:

  • PreToolUse entries with explicit matcher
  • PostToolUse entries with explicit matcher
  • non-matcher events such as Stop
  • fixture-like examples under test or fixture paths

Example Trigger

json
{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo done",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Safer Example

json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "echo done",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

How To Fix

Add an explicit matcher to each shared PreToolUse or PostToolUse entry, or move the hook under a broader event if scoped matching is not intended.