Sync auto-approved permissions from all community-patterns directories (including community-patterns-2, -3, etc.) to the shared project settings. Shows new permissions for review before adding.
Use this skill to consolidate auto-approved permissions from all your community-patterns workspaces.
When you work across multiple community-patterns directories (e.g.,
community-patterns, community-patterns-2, etc.), you accumulate different
auto-approved permissions in each directory's .claude/settings.local.json.
This skill helps you:
.claude/settings.jsonWARNING: The settings.local.json files often contain accidentally
auto-approved garbage:
Bash(do), Bash(fi), Bash(then ...)Bash(../community-patterns-2/patterns/...)The filtering step below is CRITICAL to avoid polluting project settings.
# Find all community-patterns directories
echo "=== Scanning community-patterns directories ==="
for dir in /Users/alex/Code/community-patterns*; do
echo "Found: $dir"
done
# Get all local permissions (deduplicated)
ALL_LOCAL=$(for dir in /Users/alex/Code/community-patterns*; do
jq -r '.permissions.allow[]?' "$dir/.claude/settings.local.json" 2>/dev/null
done | sort -u)
# Get project permissions
PROJECT_PERMS=$(jq -r '.permissions.allow[]?' .claude/settings.json 2>/dev/null | sort -u)
# Find new permissions - FILTER for valid patterns only
NEW_PERMS=$(comm -23 <(echo "$ALL_LOCAL") <(echo "$PROJECT_PERMS") | \
grep -E '^(Bash\(|Skill\(|Read\(|WebFetch\(|mcp__|SlashCommand)')
Present permissions in categories to help the user decide:
echo "=== General Bash commands (worth syncing) ==="
echo "$NEW_PERMS" | grep -E ':\*\)$' | grep -v '../community-patterns'
These have wildcards and are NOT path-specific. Good candidates to sync.
echo "=== WebFetch domains ==="
echo "$NEW_PERMS" | grep '^WebFetch'
echo "=== Skills ==="
echo "$NEW_PERMS" | grep '^Skill'
echo "=== MCP tools ==="
echo "$NEW_PERMS" | grep '^mcp__'
echo "=== Path-specific permissions (SKIP) ==="
echo "$NEW_PERMS" | grep '../community-patterns'
These are specific to a particular checkout and should NOT be synced.
Use AskUserQuestion to walk through each category:
Ask about each permission individually or in logical groups.
After user approval, edit .claude/settings.json to add the approved
permissions to the permissions.allow array.
Use the Edit tool to add each permission as a new line in the array.
.claude/settings.local.json.claude/settings.json to find new onesjq . .claude/settings.json > /dev/nullBash(command:*) - wildcarded commandsBash(git subcmd:*) - git subcommandsBash(deno task:*), Bash(timeout N command:*) - tool commandsWebFetch(domain:example.com) - domain-specific fetchSkill(skill-name) - skill invocationsmcp__server__tool - MCP tool permissionsRead(//path/**) - read patterns with wildcardsBash(../community-patterns-N/...) - relative paths to specific checkoutsBash(do), Bash(fi), Bash(then ...) - shell fragments