Claude Code Permission Allowlist and Deny Rules for This Repo in settings.json
Has Claude Code read your repo's scripts and CI, then propose allow, ask and deny permission rules with a reason for each, split into shared and local settings files, plus commands to test them.
You geta table of Rule, List, File, Reason; then the JSON for each file; then a test of three commands that should run without a prompt and three that should be blocked. Rule syntax…
Prompt
mkdir -p .agents/skills/claude-code-permission-allowlist-and-deny-rules-for-this-repo-in && curl -sL "https://prompts-gpt.com/prompts/claude-code-permission-allowlist-and-deny-rules-for-this-repo-in-settings-json/raw" -o .agents/skills/claude-code-permission-allowlist-and-deny-rules-for-this-repo-in/SKILL.mdYou are working in this repository in Claude Code. Build a permissions block for .claude/settings.json from the commands this repo actually uses.
Steps:
1. Read package.json scripts, any Makefile, justfile or Taskfile, and the CI workflow files. List the read-only, build, lint and test commands.
2. Propose permissions.allow rules as exact patterns in Claude Code rule syntax, such as Bash(npm run test:*) or Read(./src/**). Allow only commands that cannot delete data, publish, or reach production.
3. Propose permissions.deny rules for: rm -rf, git push --force, git reset --hard, reading .env files and key or secret files, and any deploy, migrate or publish command aimed at production.
4. Propose permissions.ask rules for actions that are fine after a check: git push, installing packages, migrations on local or staging.
5. Split the rules between .claude/settings.json (shared, committed) and .claude/settings.local.json (personal, not committed).
Rules: give a one-line reason for every rule; Bash deny patterns match command prefixes and can be sidestepped (a script, an alias, another flag order), so for anything destructive also say whether sandboxing or a PreToolUse hook is the safer guard; if a command's effect is unclear, put it under ask and say why; do not write any file until I approve.
Output format: a table of Rule, List, File, Reason; then the JSON for each file; then a test of three commands that should run without a prompt and three that should be blocked. Rule syntax changes between releases, so check it against the current Claude Code permissions docs before saving.Example output
Run in Claude Code at the root of a repo. Review the table, approve, then try the six test commands and run /permissions to confirm the rules loaded.
Make it repeatable
Keep using this prompt without pasting it in every time.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Tool Permission Matrix and Function Spec for a Tool-Using Agent
Produces a least-privilege tool inventory, function definitions, and approval rules for an agent that calls APIs or internal systems.
Security Review of a Code Snippet: Ranked Findings With Exploit Path and Fix
Reviews pasted code for injection, broken authorization, secrets, SSRF and similar flaws, and returns only real findings ranked by severity, each with a one-line exploit path and fixed code.
Design an AI Agent With Tools, Guardrails and Eval Cases Before You Build It
Turns an agent idea into a build-ready design: the job, the tools with their inputs and permissions, guardrails, failure handling and a set of evaluation cases to test it.
Claude Code Hook Writer: Auto-Run Lint, Typecheck or Tests After Edits
Produces a PostToolUse hook entry for settings.json, the script it calls and a concrete procedure to test that the check runs after file edits.
Coding Agent Task Brief with Guardrails, Test Plan, and Rollback Steps
Creates a scoped brief for an AI coding agent that limits file changes, defines tests, and includes a rollback plan and review checklist.
Codex Pull Request Review With Comments Ranked by Severity
Has Codex review a pull request and return comments sorted into blocking, should-fix and nit, each with the file and line, the risk, and a suggested change.
- Pre-Merge Code Review Checklist Skill (SKILL.md)
- Checkable Guardrail Rules for a Coding Agent: Blocked Commands, Approvals, Secrets and Hooks
- Agent Pipeline Failure Mode Audit with Retry, Fallback, and Human Escalation Rules
- Build a Strong Password Generator with Strength Meter in One HTML File
- Custom GPT Builder: Full Instructions, Starters, Files and Boundaries
- Agent Run Pre-Mortem and Self-Correction Loop Designer