permission-auditor
Reviews your
.claude/settings.jsonfor overpermissive allowlists, missing denylists, and known-risky tool combos. Suggests safer defaults.
When to activate
Trigger phrases: audit my settings, audit permissions, safer claude, /audit-perms, am I too permissive.
Auto-activate the FIRST time the user runs Claude Code in a fresh repo (no .claude/settings.json present) — offer to scaffold a safe default.
What it checks
Allowlist issues
- Wildcard
Bash(*)— too broad, suggest tightening Bash(rm -rf*)allowed — dangerousBash(curl|wget*)allowed without URL scope — data exfil riskWrite(*)allowed across entire filesystem — should scope to projectEdit(*)outside project root — same
Denylist gaps
- No deny on
.env,*.key,*.pem,id_rsa* - No deny on
~/.aws/,~/.ssh/,~/.kube/ - No deny on
**/secrets/** - No
git push --forcedeny - No
rm -rf /style deny
Hook gaps
- No PreToolUse hook to log bash commands
- No Stop hook (you lose session metadata)
- No safety net for
WebFetchto internal URLs
Output
Permission audit: .claude/settings.json
======================================
Allowlist (8 rules):
✓ Bash(npm install:*) - scoped
✓ Bash(npm run *) - scoped
⚠ Bash(*) - TOO BROAD. Tighten to specific allowed commands.
⚠ Write(*) - no path scope. Limit to project root.
Denylist (2 rules):
⚠ Missing: Read(./.env)
⚠ Missing: Read(./id_rsa*)
⚠ Missing: Bash(git push --force*)
⚠ Missing: Bash(rm -rf /*)
Hooks: none configured.
Recommend at minimum:
- PreToolUse: log Bash commands to a session file
- Stop: sync this conversation to your vault
Suggested patches: (apply with /audit-perms apply)
- Add 4 deny rules above
- Replace Bash(*) with: Bash(npm:*), Bash(git:*), Bash(python:*), Bash(pytest:*)
- Add the two hooks
Process
- Read
.claude/settings.json(project) and~/.claude/settings.json(user) - Parse allow/deny/hook arrays
- Run rule checks above
- Score: 0-100 safety score
- Generate suggested patch as a JSON diff
- Offer to apply
Inputs
- Project
.claude/settings.json - User-level
~/.claude/settings.json - Project file tree (to scope Write/Edit rules)
Outputs
- Audit report (markdown)
- Suggested JSON patch
- One-line summary (e.g. "Safety score: 62/100. 4 issues, 2 critical.")
Slash command
/audit-perms— run the audit/audit-perms apply— apply the suggested patches
Critical issues that block apply
If any of these are missing, the auditor refuses to skip them:
- Deny on
Read(./.env*)andRead(./*.key) - Deny on
Bash(rm -rf /) - Deny on
Bash(git push --force* main)/master