sync-permissions
Skill150 starsChanged 12 days agoMITView on GitHub
Reconcile the current project's Claude and Codex permission surfaces with the canonical global policy. Use when project permissions are missing, stale, or inconsistent after setup or migration. Not for syncing skills, hooks, or agents; use $sync-ai-infra.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Joshua-Palamuttam/workbench-templatetheir own version, first seen Mar 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Joshua-Palamuttam/workbench-template★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository89 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beamer-deckSkill
- bib-coverageSkill
- bib-filterSkill
- bib-parseSkill
- brief-compliance-checkSkill
- camera-readySkill
- causal-designSkill
- checkpointSkill
- code-archaeologySkill
- compile-knowledgeSkill
- computational-experimentsSkill
- cross-language-checkSkill
- data-analysisSkill
- devils-advocateSkill
- docs-consistencySkill
- docxSkill
- experiment-designSkill
- grill-meSkill
- handoffSkill
- ideasSkill
- init-project-courseSkill
- init-project-lightSkill
- init-project-orchestrationSkill
- init-projectSkill
- insights-deckSkill
- interview-meSkill
- knowledge-lintSkill
- latex-diffSkill
- latex-health-checkSkill
- latex-polishSkill
- latex-postersSkill
- latex-scaffoldSkill
- latexSkill
- latex-templateSkill
- lean-checkSkill
- math-proofSkill
- mcp-builderSkill
- method-auditSkill
- multi-perspectiveSkill
- numerical-checkSkill
- pdfSkill
- pipeline-manifestSkill
- playwright-cliSkill
- postmortemSkill
- pre-commit-auditSkill
- pre-submission-reportSkill
- project-deckSkill
- project-safetySkill
- proof-readabilitySkill
- proofreadSkill
- python-envSkill
- quarto-deckSkill
- reorgSkill
- replication-auditSkill
- replication-packageSkill
- retarget-journalSkill
- review-clusterSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 14 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
After adding new permissions to ~/.claude/settings.json
- Distinctive: line 19
When starting work in a project that hasn't been updated in a while
- Distinctive: line 20
After creating a new skill and wanting it available everywhere
- Distinctive: line 21
When the user says "sync permissions", "update rules", "update my permissions"
- Distinctive: line 32
Never removes existing project permissions (additive only)
- Very specific: line 33
Never modifies ~/.claude/settings.json (reads it, never writes)
- Very specific: line 34
Never touches model, hooks, or other global settings keys
- Distinctive: line 42
Read these two files:
- Distinctive: line 46
If the local file doesn't exist, create it with global permissions (same as the SessionStart hook).
- Distinctive: line 51
Start with all existing local permissions (preserve everything)
- Distinctive: line 52
Add any global permissions not already present in local
- Distinctive: line 63
If there are new permissions to add:
- Distinctive: line 64
Read the full local settings file (preserve any non-permissions keys)
- Very specific: line 66
Write back to .claude/settings.local.json
- Distinctive: line 68
If no new permissions, skip the write.
- Very specific: line 72
Check that <skills-root>/ exists and has content:
- Distinctive: line 73
If missing or empty, warn: "Skills directory missing — run the documented managed-copy installer or deployment command"
- Distinctive: line 74
If present, report file count
- Distinctive: line 79
If missing or empty, warn: "Agents directory missing — run the documented managed-copy installer or deployment command"
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Update Rules Skill
Sync global permissions, skills, and agents into the current project without losing project-specific settings.
Purpose
The SessionStart hook only copies permissions when .claude/settings.local.json doesn't exist yet. After that, new global permissions never propagate to existing projects. This skill fills that gap — run it anytime to pull in new permissions additively.
When to Use
- After adding new permissions to
~/.claude/settings.json - When starting work in a project that hasn't been updated in a while
- After creating a new skill and wanting it available everywhere
- When the user says "sync permissions", "update rules", "update my permissions"
What It Does
- Merge permissions — adds global permissions into project-local, keeping any project-specific ones
- Verify skills directory — ensures
<skills-root>/exists and has content - Verify agents directory — ensures
~/.claude/agents/exists and has content - Report changes — shows exactly what was added
What It Does NOT Do
- Never removes existing project permissions (additive only)
- Never modifies
~/.claude/settings.json(reads it, never writes) - Never touches
model,hooks, or other global settings keys
Workflow
Step 1: Read Both Permission Files
Read these two files:
- Global:
~/.claude/settings.json→ extractpermissions.allowarray - Local:
.claude/settings.local.json→ extractpermissions.allowarray
If the local file doesn't exist, create it with global permissions (same as the SessionStart hook).
Step 2: Compute the Union
Merge the two permission arrays:
- Start with all existing local permissions (preserve everything)
- Add any global permissions not already present in local
- Sort the final array for readability
The merge logic:
new_permissions = local_permissions ∪ global_permissions
added = new_permissions - local_permissionsStep 3: Write the Merged Result
If there are new permissions to add:
- Read the full local settings file (preserve any non-permissions keys)
- Replace
permissions.allowwith the merged array - Write back to
.claude/settings.local.json
If no new permissions, skip the write.
Step 4: Verify Skills Directory
Check that <skills-root>/ exists and has content:
- If missing or empty, warn: "Skills directory missing — run the documented managed-copy installer or deployment command"
- If present, report file count
Step 5: Verify Agents Directory
Check that ~/.claude/agents/ exists and has content:
- If missing or empty, warn: "Agents directory missing — run the documented managed-copy installer or deployment command"
- If present, report file count
Step 6: Report
Output a summary:
Permissions sync complete:
- Global permissions: [N]
- Local permissions (before): [N]
- New permissions added: [N] — [list them]
- Local permissions (after): [N]
- Skills directory: ✓ [N] files / ✗ missing
- Agents directory: ✓ [N] files / ✗ missingIf nothing changed:
Everything up to date. No new permissions to add. Skills OK. Agents OK.Example
Running sync-permissions after adding web fetch and Skill(literature) to ~/.claude/settings.json:
Permissions sync complete:
- Global permissions: 25
- Local permissions (before): 64
- New permissions added: 2 — web fetch, Skill(literature)
- Local permissions (after): 66
- Skills directory: ✓ 496 files
- Agents directory: ✓ 16 filesSafety
- Additive only — the skill can only add permissions, never remove them
- No global writes — global settings are read-only
- Directory check — verifies skills/agents directories exist and have content
- Idempotent — safe to run multiple times; re-running with no changes produces no writes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

