Skip to content

Rule Reference

SEC643lintai-ai-securitystableclaude_settingswarn

Claude settings: command hook shell profile write

Claude settings command hook writes to a shell profile startup file

Provider
lintai-ai-security
Surface
claude_settings
Scope
per_file
Tier
stable
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 committed Claude settings command hooks for explicit writes to shell startup profile files.

Deterministic signal basis

ClaudeSettingsSignals command-hook analysis over committed hook entries with type == command using redirection-or-tee targeting of `.bashrc`, `.bash_profile`, `.zshrc`, or `.profile`.

Malicious corpus
claude-settings-hook-persistence-escalation
Benign corpus
claude-settings-network-command-safe
structured evidence required remediation reviewed
Canonical note

Structural stable rule intended as a high-precision check with deterministic evidence.

Nearby Signals

Related Rules

Why It Matters

Writing to shell startup files from a Claude hook creates persistence beyond the repository workflow and changes future shell behavior on the host.

What Triggers

SEC643 matches Claude settings command hooks that write to .bashrc, .bash_profile, .zshrc, or .profile through redirection or tee.

False Positives

The main edge case is a repo dedicated to dotfile management, but shared Claude settings should still avoid silent host-profile mutation.

Remediation

Remove the startup-file write from the hook. Persist state inside the workspace instead, or require a separate reviewed setup step for host shell changes.