From thinking
Audit Claude Code settings.json files for overly broad permissions, overlapping rules, and cross-file redundancy. Produces a reconciled config.
npx claudepluginhub hpsgd/turtlestack --plugin thinkingThis skill is limited to using the following tools:
Audit Claude Code settings files and produce a reconciled configuration. If $ARGUMENTS specifies a path, use that as the project root; otherwise use the current working directory.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Calculates TAM/SAM/SOM using top-down, bottom-up, and value theory methodologies for market sizing, revenue estimation, and startup validation.
Audit Claude Code settings files and produce a reconciled configuration. If $ARGUMENTS specifies a path, use that as the project root; otherwise use the current working directory.
Find every settings file that applies to the current context. Check these locations in order (highest to lowest priority):
| Scope | Path | Shared? |
|---|---|---|
| Local project | .claude/settings.local.json | No (gitignored) |
| Shared project | .claude/settings.json | Yes (committed) |
| User global | ~/.claude/settings.json | No |
# Check each location exists and is valid JSON
for f in .claude/settings.local.json .claude/settings.json ~/.claude/settings.json; do
if [ -f "$f" ]; then
echo "FOUND: $f ($(wc -l < "$f") lines)"
fi
done
Read each file that exists. If a file has invalid JSON, report the parse error and skip it.
From each file, extract the permissions.allow, permissions.deny, and permissions.ask arrays. For each rule, classify it:
Tool type (parse from the rule prefix):
Bash(...) — shell command permissionsRead(...) / Edit(...) / Write(...) — file access permissionsWebFetch(...) / WebSearch — network permissionsSkill(...) — skill invocation permissionsmcp__* — MCP server permissionsAgent(...) — subagent permissionsSpecificity level (from most to least specific):
Bash(npm run build)Bash(git commit:*)Bash(curl *), Bash(grep:*)Bash, WebSearchA permission is "overly broad" when it grants ability to execute arbitrary code or access arbitrary resources without meaningful constraint. Flag any rule matching these patterns:
Always flag (high risk):
Bash with no arguments (allows any shell command)Bash(python*), Bash(node*), Bash(ruby*) — arbitrary script executionBash(curl *), Bash(wget *) — arbitrary network requests from shellBash(rm *), Bash(sudo *) — destructive operationsRead or Edit with no path constraintWebFetch with no domain constraintFlag as suspicious (medium risk):
Bash(grep:*), Bash(find *) — broad filesystem inspection (usually fine, but worth noting if more specific rules exist)Bash(cd:*) — directory traversal (rarely useful as a permission)Bash(ls:*) — broad directory listingRead(~/*) or Read(//Users/**)Flag as fragments (likely junk):
Bash(done), Bash(do), Bash(do echo:*) — shell loop fragments that got approved individuallyBash(echo *) — echo statements approved during debuggingwhile read, for f, xargsFor each flagged rule, report:
Compare all rules pairwise within and across files. Identify:
Subsets (one rule covers the other):
Bash(git commit *) is a subset of Bash(git *)Bash(npm run build) is a subset of Bash(npm run *) which is a subset of Bash(npm *)Read(/src/**/*.ts) is a subset of Read(/src/**)WebFetch(domain:api.github.com) is a subset of WebFetch(domain:github.com) (subdomain matching)When one rule is a strict subset of another, recommend keeping only the broader rule — unless the broader rule was flagged as overly broad in Step 3, in which case keep the narrower rules and remove the broad one.
Duplicates across files:
.claude/settings.json and .claude/settings.local.jsonextraKnownMarketplaces entry in multiple filesFor duplicates, recommend keeping the rule at the appropriate scope:
.claude/settings.json (shared) or .claude/settings.local.json (personal)~/.claude/settings.jsonConflicting rules:
allow at one scope and deny at anotherallow and ask at the same scopeReport conflicts with which scope wins (deny always wins; for allow vs ask, the more restrictive scope wins).
Review other settings for redundancy:
enabledPlugins:
extraKnownMarketplaces:
env:
Present the audit as a structured report, then offer a reconciled configuration.
## Settings Audit Report
### Files discovered
- [list each file with line count]
### Overly broad permissions (Step 3)
| Rule | File | Risk | Recommendation |
|---|---|---|---|
| ... | ... | ... | ... |
### Overlapping rules (Step 4)
| Broader rule | Narrower rule(s) | Recommendation |
|---|---|---|
| ... | ... | ... |
### Cross-file redundancy (Step 4-5)
| Setting | Found in | Recommendation |
|---|---|---|
| ... | ... | ... |
### Fragments and junk rules
[list with recommendation to remove all]
### Summary
- X rules reviewed
- Y flagged as overly broad
- Z overlapping pairs found
- W redundant across files
- N fragments/junk rules
After presenting the report, produce a clean version of each settings file with:
Present the reconciled files as diffs against the current files so the user can see what changed.
Use AskUserQuestion to present the reconciled configuration and ask the user which changes to apply. Offer these options:
Only write to settings files after explicit approval. Never modify settings files without asking.
Bash(python3 *) allows execution of any Python script" is useful. "This is too broad" is not.Bash(git *) in a developer's global settings is probably intentional. Flag it, but don't treat it as equivalent to Bash(rm *).settings.local.json were put there for a reason (personal, not shared). Don't move them to settings.json without asking.done, do, do echo:*) and one-off inline scripts with heavy escaping are almost always auto-approved accidents, not intentional permissions. Flag them confidently.Bash(git *) and Bash(python3 *) are different risk levels. Git commands are version control operations. Python is arbitrary code execution./thinking:health-check — broader project setup audit (rules, plugins, memory, docs). Use when you want a full picture beyond just settings./update-config — built-in skill for adding new configuration. Use that for setup, use this skill for cleanup.