permissions
Skill75 starsChanged 2 months agoMITView on GitHub
Configures Claude Code permissions for low-prompt work inside a project; changes nothing under Codex. Creates or merges allow/deny rules in .claude/settings.json and installs a PreToolUse hook gating out-of-project writes and deletes, precious untracked files, and history-changing git on protected branches. Writes only under .claude/, including an ownership record. Use after /optimus:init or standalone.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- reisi007/agents-skillstheir own version, first seen Nov 5, 2026
- pantalytics/odoo-mcp-protheir own version, first seen Oct 12, 2026
- aborroy/aiup-alfrescotheir own version, first seen Jun 22, 2026
- Veeiy/vantage-ostheir own version, first seen Jun 6, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- pantalytics/odoo-mcp-pro★ 91same name
- aborroy/aiup-alfresco★ 14same name
- reisi007/agents-skills★ 0same name
- Veeiy/vantage-os★ 0same 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- brainstormSkill
- code-reviewSkill
- commitSkill
- deepSkill
- dreamSkill
- gauntletSkill
- handoffSkill
- how-to-runSkill
- initSkill
- jiraSkill
- paper-initSkill
- promptSkill
- prSkill
- refactorSkill
- resetSkill
- tddSkill
- unit-testSkill
- worktreeSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
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 20
If .claude/settings.json exists, read it in full.
- Very specific: line 22
If .mcp.json exists at the project root, extract the top-level MCP server names for Step 3.
- Very specific: line 28
When creating or replacing as selected, cp $CLAUDE_PLUGIN_ROOT/skills/permissions/templates/hooks/restrict-paths.sh to …
- Very specific: line 34
If .claude/settings.json does not exist, create it from the template.
- Very specific: line 54
If .claude/CLAUDE.md does not exist, recommend /optimus:init next.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimus Permissions
Under Codex, stop without changing files: this skill configures Claude Code only. Recommend configuring Codex's own sandbox and approval policy instead.
Configure permission rules and a path-restriction hook so Claude Code agents can work autonomously inside the project without constant prompts, while destructive operations outside it stay gated.
To remove this setup while keeping init's artifacts, use /optimus:reset permissions.
$CLAUDE_PLUGIN_ROOT below means this skill's base directory minus /skills/permissions. Write that absolute path into every Bash command, where the variable can be empty. Read $CLAUDE_PLUGIN_ROOT/skills/init/references/managed-files.md and apply it to the hook and every settings entry this run adds or removes. Do not write .claude/.optimus-version.
Security model in brief: the installed hook prompts on writes and blocks deletes outside the project (Claude's memory store and session scratchpad are exempt), asks before editing any precious unversioned file and blocks deleting them (backups and IDE scratch files stay deletable), and blocks history-modifying git operations on protected branches. Inside the project, operations not on the deny list run without prompts.
Step 1: Detect existing configuration
- If
.claude/settings.jsonexists, read it in full; if it is not valid JSON, show the parse problem and ask the user how to proceed before changing any file. - Note whether
.claude/hooks/restrict-paths.shalready exists (fresh install vs update). - If
.mcp.jsonexists at the project root, extract the top-level MCP server names for Step 3.
Step 2: Install the path-restriction hook
If an existing .claude/hooks/restrict-paths.sh differs from the template, apply managed-files.md's Overwrite and migration rules: replace a recorded refresh: "template" copy whose hash still matches without asking. Otherwise read it, show a concrete comparison that separates customizations from older-template drift, and use AskUserQuestion for its Merge / Keep existing / Replace choice. Keep existing also reports the remaining version/behavior difference; Replace discards only the differences explicitly shown.
When creating or replacing as selected, cp $CLAUDE_PLUGIN_ROOT/skills/permissions/templates/hooks/restrict-paths.sh to .claude/hooks/restrict-paths.sh (never re-type it through Read/Write), then apply only approved customizations. Keep-existing does not authorize a later verification step to overwrite that file.
Step 3: Create or update settings.json
Base configuration: $CLAUDE_PLUGIN_ROOT/skills/permissions/templates/settings.json.
If .claude/settings.json does not exist, create it from the template. If it exists, merge — read, merge, write, never blind-overwrite:
- permissions.allow — add template entries not already present. Never remove existing entries.
- permissions.deny — add template entries not already present. If the existing settings have git deny entries (git as a command, not part of words like
github) beyond the template's set, they may block the feature-branch workflow (commit/push) that skills like /optimus:tdd need — list them and useAskUserQuestion: Replace with template set (Recommended) — remove only the extra git deny entries and use the template's (branch protection is still enforced by the hook); non-git deny entries untouched — or Keep all. - hooks.PreToolUse — add the template's hook entry as a separate matcher group, appending to any existing array; skip if an entry already references
restrict-paths.sh. - Preserve everything else — existing PostToolUse hooks, custom sections, all unrelated configuration.
In either case, if .mcp.json was found, add mcp__<server-name> entries to permissions.allow for each server. The result must be valid JSON.
Step 4: Verify and report
Fix any issue before reporting:
- For an installed/replaced hook,
.claude/hooks/restrict-paths.shmatches the template plus only approved customizations —diffagainst it and runbash -non the installed copy. Correct accidental copy errors; preserve a file the user chose to keep. .claude/settings.jsonhas a PreToolUse entry that resolves to the installedrestrict-paths.sh— a merge that drops or misspells it leaves the project unprotected with no other symptom.- Scan for precious unversioned files. Get the rules with
sed -n '/^strip_backup_suffix() {/,/^}/p;/^is_precious_name() {/,/^}/p;/^is_recoverable_precious_name() {/,/^}/p' .claude/hooks/restrict-paths.shinstead of reading the whole hook. Exclude.git/, dependencies, build output, and.claude/.optimus-reset-backups/. Report untracked matches as protected, distinguishing the intentionally deletable backup/IDE category. Offer specific custom patterns for sensitive files the scan misses. .claude/.optimus-managed.jsonmatches the hook written and the settings entries this run added.
Report: files created or updated (fresh install vs update), allow/deny counts, detected MCP servers, and the one-line security summary from the top of this skill. Point to this skill's README for the trust model, the auto-mode layering, and the not-OS-sandboxing caveat.
If .claude/CLAUDE.md does not exist, recommend /optimus:init next; otherwise /optimus:unit-test to establish coverage or /optimus:tdd to start developing. Suggest a fresh conversation for it.
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.

