一键导入
x-consolidate-perms
Audit project-local Claude Code permissions and migrate appropriate ones to user scope
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit project-local Claude Code permissions and migrate appropriate ones to user scope
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | x-consolidate-perms |
| description | Audit project-local Claude Code permissions and migrate appropriate ones to user scope |
| model | opus |
| disable-model-invocation | true |
| allowed-tools | Bash(*), Read, Write, Edit, Glob, Grep |
You are reviewing the current project's .claude/settings.local.json permissions
and migrating appropriate entries to the user-scope ~/.claude/settings.json.
Claude Code permissions have three scopes (highest to lowest precedence):
.claude/settings.local.json) -- private, per-repo.claude/settings.json) -- committed, team-visible~/.claude/settings.json) -- global, all projectsArrays (allow, deny) merge across scopes. Deny always beats allow.
~/.claude/settings.json to understand what is already at user scope..claude/settings.local.json to see what needs review.The allow list in ~/.claude/settings.json is organized into groups
separated by blank lines. Preserve this ordering when adding entries.
deny array)Two groups, separated by a blank line:
find variants -- flags that cause find to execute or
delete: -exec, -execdir, -ok, -okdir, -delete.curl variants -- flags that send data, upload files, or
write to disk: -X POST/PUT/DELETE/PATCH, -d/--data*,
--upload-file/-T, -o/--output/-O/--remote-name.These deny rules exist because find * and curl * are broadly allowed (see
below), so the deny rules act as safety guards against their dangerous modes.
allow array), in orderCore tools -- Grep, Glob, Read (blanket allows for the built-in
readonly tools).
Skills and skill support -- Bash commands for user-level skill scripts
(e.g. ~/.claude/skills/ paths) and CLI tools those skills invoke (e.g.
jira). Paths must use full absolute paths (not ~/) because Bash
patterns match the literal command string.
MCP tool permissions -- mcp__* entries for MCP servers defined at
user scope (Google Sheets, Playwright, etc.).
Web -- WebSearch followed by WebFetch(domain:...) entries for
general-purpose development domains (docs, reference sites).
Safe-but-broad utilities -- Simple, always-readonly commands that are
useful in any project: ls, cat, echo, wc, test, grep, ps,
pgrep, ping.
Deny-guarded commands -- Commands that are broadly allowed but have
corresponding deny rules for their dangerous modes: find *, curl *.
Perl (safe only) -- Only guaranteed-safe perl commands: perl --version,
perl -v, perldoc *. Never allow perl *, perl -e *, or any form
that can execute arbitrary code.
Perlbrew (readonly subcommands) -- Only informational subcommands:
list, available, info, version, self-info, env, lib list,
which. Never allow broad perlbrew * or write operations like
install, install-cpanm, switch, use.
Git (readonly subcommands) -- Two sub-groups:
status, log, diff, show, blame, shortlog, describe, grep,
rev-parse, rev-list, ls-files, ls-tree, ls-remote, cat-file,
whatchanged, count-objects, for-each-ref, name-rev.reflog show, stash list, remote (bare), remote -v,
remote show, config --list, config --get, config --get-all,
branch --list, tag --list, tag -l.
Never allow broad git * -- subcommands like push, reset, clean
are destructive.Dev tools -- Cross-project development utilities: t * (test runner),
bin/t *, sed *, claude mcp *, aidoc-locate *, go version *.
System debugging -- Readonly system inspection commands: journalctl,
dmesg, sensors, systemctl status, last.
AWS (readonly) -- Only read operations like aws ssm get-document,
aws ssm list-documents, aws ssm describe-*. Never allow
aws configure * (it can write to ~/.aws/config).
Apply the decision framework below to every entry in the project-local file.
ls, wc, ps)perldoc, git log)./parse-nakama-alerts.pl)/export/proj/foo/bin/tool)echo $CEROOT is covered by echo *)Read(//path/**)
entries when Read is already globally allowed)while IFS=,
do echo, done as separate entries)perl *,
sudo *, rm -rf *)perl *, perl -e *, or any perl variant that can execute arbitrary codepython *, python3 *, or any Python variant (same reason)sudo * or any privileged commandssh * (too broad -- specific hosts can go in project-local if needed)gpg *, chmod *, or other commands that write to disk in hard-to-predict waysgit *,
perlbrew *, aws *)Present the categorization to the user as a table or grouped list showing:
Wait for the user to review and approve before making any changes.
After user approval:
Add new entries to user scope: Edit ~/.claude/settings.json and insert
entries into the correct group (see organizational structure above). Maintain
the blank-line separation between groups.
Handle home directory paths: For any Bash entry containing /home/buddy/
or /home/bburden/, add both variants so the file works on all machines.
Clean up the project-local file: Remove entries that were moved or are now redundant. The project-local file should only contain entries that are genuinely project-specific.
The user settings file (~/.claude/settings.json) is shared across machines
where the username may differ (/home/buddy/ vs /home/bburden/). All
entries must be written to work on both machines.
| Context | Strategy | Example |
|---|---|---|
additionalDirectories | Use ~/ | ~/common/aidoc |
Read/Edit patterns | Use ~/ | Read(~/common/aidoc/**) |
| Hook commands | Use ~/common/ | ~/common/conf/ai/devtools/script |
statusLine command | Use ~/ | bash ~/.claude/statusline-command.sh |
| Bash permission patterns | Full absolute paths, both variants | See below |
| MCP server paths | Machine-specific (not portable) | Leave as-is |
~/common/ symlinkBoth machines have ~/common/ symlinked to the actual common repository
checkout. Always use ~/common/ instead of the absolute repo path in
hooks, additionalDirectories, and anywhere else that supports tilde
expansion.
Bash patterns match the literal command string that Claude generates. Since
Claude resolves paths to absolute form, ~/ in a Bash pattern will not match
/home/buddy/.... For Bash entries with home directory paths, include both
username variants:
"Bash(/home/buddy/.claude/skills/x-take-ticket/scripts/ticket-preflight)",
"Bash(/home/bburden/.claude/skills/x-take-ticket/scripts/ticket-preflight)",
Bash(git log *), not
Bash(git log:*). The colon form is deprecated.* matches zero or more after a space (word boundary). Bash(cmd *)
matches both cmd (bare) and cmd arg1 arg2.~/ and should use
it for portability.additionalDirectories also supports ~/.perl *, git *,
ssh *, aws * are too dangerous. Use specific subcommands.find or curl), add corresponding deny
rules too.Create a new Jira ticket with user-approved summary and description
Assess the current state of a Jira ticket and produce a summary for development work
Load full context for modifying Claude Code configuration, settings, hooks, MCP servers, skills, or the wrapper script on this machine
Convert an existing instruction file (scenario, agent, command) into a proper Claude Code skill
Claim a Jira ticket and set up tracking (administrative only - NO technical work)
Expert code review of the most recent commit