Skip to content

Rule Reference

SEC368lintai-ai-securitycompatqualitypreviewclaude_settingswarn

Claude settings: repo-external absolute hook path

Claude settings hook command uses a repo-external absolute path in a shared committed config

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 repo-external absolute hook command paths.

Deterministic signal basis

ClaudeSettingsSignals exact command-path analysis for repo-external absolute hook commands in parsed Claude settings JSON.

Malicious corpus
claude-settings-repo-external-absolute-hook-path
Benign corpus
claude-settings-repo-external-absolute-hook-safe
structured evidence required remediation reviewed
Canonical note

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

Nearby Signals

Related Rules

Why It Matters

SEC368 flags committed Claude settings hook commands that start with a repo-external absolute path such as /opt/... in a shared team-facing config.

This is useful because:

  • shared Claude settings in git should stay portable across machines and contributors
  • repo-external absolute paths make hook wiring harder to review, reproduce, and safely rotate
  • project-scoped wrapper paths rooted in $CLAUDE_PROJECT_DIR are easier for teams to understand and maintain

Positioning

This is a compat rule, not a headline security finding. The problem is shared-config portability and reviewability, so it belongs in the compatibility lane.

What Triggers

This rule applies only to committed Claude settings surfaces:

  • .claude/settings.json
  • claude/settings.json

It triggers when a hooks entry with type: "command" has a command string that starts with a repo-external absolute path such as:

  • /opt/...
  • /usr/local/...
  • /etc/...
  • /var/...
  • /private/...
  • /tmp/...
  • /Volumes/...
  • /srv/...

It does not trigger on:

  • project-scoped paths rooted in $CLAUDE_PROJECT_DIR
  • common system launcher paths such as /bin/sh -lc ...
  • fixture-like test/example paths

Examples

Bad:

json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/opt/team/hooks/audit.sh"
          }
        ]
      }
    ]
  }
}

Better:

json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$CLAUDE_PROJECT_DIR/scripts/audit.sh"
          }
        ]
      }
    ]
  }
}

Remediation

  • replace repo-external absolute hook commands with project-scoped wrappers
  • prefer repo-relative launch paths rooted in $CLAUDE_PROJECT_DIR
  • keep shared Claude settings portable across machines