Skip to content

Rule Reference

SEC382lintai-ai-securitypreviewclaude_settingswarn

Claude settings: `matcher` on unsupported hook event

Claude settings should not use `matcher` on unsupported hook events

Provider
lintai-ai-security
Surface
claude_settings
Scope
per_file
Tier
preview
Severity
warn
Confidence
high
Detection
structural
Remediation
message_only

Activation Model

Preset Membership

This rule is part of the builtin activation graph through these preset memberships.

Lifecycle

Stable Lifecycle Contract

State

stable_gated

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.

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.