Skip to content

Rule Reference

SEC643lintai-ai-securitythreat-reviewsecuritystableclaude_settingswarn

Claude settings: command hook shell profile write

Claude settings command hook writes to a shell profile startup file

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

Explicit malicious, secret-bearing, or spyware-like review.

How to read this category

Strong exploit, secret, or unsafe-execution 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 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 positioned as an explicit threat-review control: high-signal malicious, credential-bearing, or spyware-like behavior that stays opt-in rather than shaping the quiet default.

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.