Skip to content

Rule Reference

SEC382lintai-ai-securitycompatqualitypreviewclaude_settingswarn

Claude settings: `matcher` on unsupported hook event

Claude settings should not use `matcher` on unsupported 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 use of `matcher` on unsupported hook events.

Deterministic signal basis

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

Malicious corpus
claude-settings-matcher-on-stop-event
Benign corpus
claude-settings-matcher-pretooluse-safe
structured evidence required remediation reviewed
Canonical note

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

Nearby Signals

Related Rules

SEC382 / CLAUDE-HOOK-MATCHER-EVENT

SEC382 flags shared Claude settings when a hook event uses matcher outside matcher-capable events such as PreToolUse and PostToolUse.

Why It Matters

This is a quiet contract bug. A reviewer can easily assume matcher is shaping the hook scope, while the event itself may not support matcher semantics at all. That makes the shared hook policy harder to reason about and easier to misread.

Positioning

This is a compat rule, not a headline security finding. The problem is configuration correctness and reviewer clarity, so the rule 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 hook event other than PreToolUse or PostToolUse contains matcher

Clean Cases

These stay clean:

  • matcher under PreToolUse
  • matcher under PostToolUse
  • hook events without matcher
  • fixture-like examples under test or fixture paths

Example Trigger

json
{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "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

Remove matcher from unsupported hook events, or move the hook under a matcher-capable event if scoped tool matching is actually required.