Clauditor
Clauditor is a Python CLI that audits Claude Code configuration across user, project, local, and managed scopes for security misconfigurations, using 50+ YAML-defined checks each with severity, attack scenario, and remediation. It detects risks like unlocked bypass-permissions mode, project-level credential-generating hooks committed to git, and missing managed-settings enforcement, and can generate a hardened settings JSON or run with --exit-code in CI pipelines.
What it is
Clauditor is a Python CLI (install via pipx install clauditor) that scans Claude Code's configuration for security misconfigurations. Beyond the checks the summary lists, the page's value is in why the scopes matter and the exact commands to run — the mechanism and the CI/enforcement workflow.
How it works
Claude Code reads settings from four scopes — user, project, local, managed — and applies the highest-precedence value when a setting appears in more than one. The threats map to these scopes:
- Project settings (
.claude/settings.json) are a supply-chain vector. They are committed to git and apply to everyone who clones the repo. A maintainer (or a compromised maintainer account) can add a session-start hook that exfiltrates your API key, grant unrestricted Bash, or redirect telemetry — a lateral-movement path most existing tooling doesn't inspect. - Credential-helper scripts defined at project level run untrusted, in-repo code with access to your credentials on every session start, with no prompt. Clauditor flags helpers defined at the project scope, "where they should never be."
- Managed settings are the enforcement layer — deployed via MDM, highest precedence, not user-overridable. Without one, every instance runs whatever (possibly insecure) defaults the user or project set. Managed settings are also where you'd wire OpenTelemetry export to get an audit trail of tool calls and bash commands across a fleet.
Preconditions / Affected
Anyone running Claude Code who clones or contributes to repos they don't fully control. The poisoned-doc / reverse-shell class of attack only succeeds if the config permits unrestricted shell and network access — Clauditor's job is to show you how open your current permissions actually are.
What to do
# Scan current dir (project + user scope)
clauditor scan
# Clone and scan a remote repo before working in it
clauditor scan --url https://github.com/org/repo
# Filter to the checks that matter, with remediation steps
clauditor scan --severity CRITICAL,HIGH -v
# Fail the build on any finding (CI)
clauditor scan --exit-code
# Enforce a minimum required scope, e.g. managed-level
clauditor scan --base-level managed
# Generate a hardened managed settings file covering all checks
clauditor generate --scope managed -o managed-settings.json
# List every built-in check
clauditor list-checksThe --base-level flag (not in the summary) enforces a minimum required scope — use it to require that hardening exists at the managed level rather than trusting per-user config.
Caveats
Managed settings only override user/project settings "if they don't have the necessary permissions" — the enforcement guarantee depends on that. The page is the project's own README, so severity ratings and check coverage are self-reported; verify against list-checks before relying on it as compliance evidence.
Technologies named here
- Claude Code
- Clauditor
- pipx
- Python
Techniques named here
- Malicious project-level Claude Code settings
- Prompt injection via poisoned documentation
- Credential harvesting via repository-defined helper scripts
- Bypass permissions mode abuse
Related in AI Security
