permission-unblock
Skill0 starsChanged 22 days agoMITView on GitHub
When a Claude Code tool call is refused - a permission prompt denied or unanswerable, "This command requires approval", "Blocked by classifier" / "Denied by auto mode classifier", a deny rule, or a PreToolUse hook - work out which gate refused it and output the exact, narrowest JSON rule for the project's .claude/settings.json (never user-global), or explain why no rule should be added. Use immediately on any denial, and when the user says "why was that blocked", "allow this command", "add a permission rule", "stop asking me for X", "open the permissions".
- Deletes or force-pushes
- Commits and pushes
In this repository4 other files it gives its agents.
- multi-session-gitSkill
- post-deploy-smokeSkill
- prove-its-liveSkill
- secret-guardSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Never retry the same thing in a different spelling to slip past a rule (sh -c, a full path, a script that does it).
- Very specific: line 69
Never suggest bypassPermissions, --dangerously-skip-permissions, Bash(*) or turning auto mode off to "make it work".
- Distinctive: line 70
Never add a rule after the user said no.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Permission unblock
A refusal comes from one of four gates, and each has a different fix. Adding an allow rule fixes only one of them. Guessing wastes the user's time and teaches them to click "allow everything".
| Gate | Typical text | Fix |
| Missing allow rule | "requires approval", a prompt you could not get answered (headless, dontAsk) | narrowest permissions.allow rule in the project's .claude/settings.json |
| User declined | "the user doesn't want to proceed", a "No" at the prompt | no rule. Ask what they want instead. Never retry another way |
| Deny rule | "denied", a rule named in the message | allow can never override deny. /permissions shows which file holds it; only its owner changes it |
| PreToolUse hook | "hook", "PreToolUse:Bash hook error", a custom reason | allow rules do not help (a blocking hook runs first). Do what the hook asks, or the user changes the hook |
| Auto mode classifier | "Blocked by classifier", "Denied by auto mode classifier [Rule Name]" | see below |
Run
node ${CLAUDE_SKILL_DIR}/suggest-rule.mjs --tool Bash --command "<the exact denied command>" --message "<the exact denial text>" --project /full/path/to/project
node ${CLAUDE_SKILL_DIR}/suggest-rule.mjs --tool WebFetch --url https://docs.example.com/page
node ${CLAUDE_SKILL_DIR}/suggest-rule.mjs --tool Edit --path src/app.ts --project /full/path/to/project
node ${CLAUDE_SKILL_DIR}/suggest-rule.mjs --tool mcp__github__create_issueIt prints the gate, what to do, one rule per part of a compound command, warnings, and the JSON block.
Show the user, in this shape
- What was refused: the exact command or tool call.
- Which gate: one of the five above, and how you know (quote the message).
- The fix: the JSON and the full path of the file:
File:{ "permissions": { "allow": ["Bash(npm run build *)"] } }/full/path/to/project/.claude/settings.json. Merge into the existingpermissions.allowarray; do not replace the file. (--writemerges it for them, without duplicates, after they approve.) - What it allows and what it does not, in one line: "allows
npm run buildwith any arguments; not other npm scripts".
Writes to .claude/ are protected, so expect to hand the user the JSON (or /permissions > Allow) rather than editing it yourself.
Rules for the rule (from the current permission syntax)
Bash(npm run build *):*matches any text; a space before a trailing*also matches the bare command.Bash(ls:*)is the older equivalent form; prefer the space form, which the permission dialog writes.- Narrowest that covers the need: program + subcommand (+ script name) +
*. NeverBash(*),Bash(git *),Bash(node *),Bash(npx *),Bash(sh *),Bash(docker exec *): those allow arbitrary code. - Rules match the text as written:
Bash(git push *)does not matchgit -C /repo push,/usr/bin/git pushorsh -c 'git push'. Write the rule for the form actually used. - Compound commands (
a && b, pipes) need a rule per part. LeadingVAR=valueandtimeout/nice/nohupwrappers are stripped before matching;npx,docker exec,devbox runare not. - Interpreters: allow a fixed script (
Bash(node scripts/check.mjs *)), never inline code (node -e,python -c, heredocs): those get an exact rule or a one-time approval. - Files:
Edit(/src/app.ts)(leading/= project root in project settings),Read(//etc/hosts)(//= absolute),Read(~/notes/**). Write and NotebookEdit are governed byEdit(...)rules. - Web:
WebFetch(domain:docs.example.com); subdomains needWebFetch(domain:*.example.com). MCP:mcp__<server>__<tool>. - Destructive or production commands (
rm -rf, force push,vercel --prod,terraform apply, a push tomain): recommend approving each time, or anaskrule, not an allow rule. - Project settings only:
<project>/.claude/settings.json(shared) or.claude/settings.local.json(just this user). Never~/.claude/settings.jsonfor a project's needs.
Auto mode classifier
- A narrow project allow rule (like the ones above) is resolved before the classifier, so it lets that exact action through. Broad rules (
Bash(*), interpreter wildcards) are suspended in auto mode, andautoMode.classifyAllShell: truesuspends all shell allow rules. - One-off action the user really intended: tell them what was blocked and why (the
[Rule Name]in brackets); if they confirm in their own words, retry once./permissions> Recently denied >ralso retries it. - Recurring trusted destination (their GitHub org, an internal domain, a bucket): that belongs in
autoMode.environment, which the classifier reads only from~/.claude/settings.jsonor managed settings, never from project files. Show them the entry; it is their decision to add it.
Never
- Never retry the same thing in a different spelling to slip past a rule (
sh -c, a full path, a script that does it). That is circumventing the user's control. - Never suggest
bypassPermissions,--dangerously-skip-permissions,Bash(*)or turning auto mode off to "make it work". - Never add a rule after the user said no.
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.

