Free Tool
Claude Code Permissions Generator
Decide once which commands Claude Code may run without asking, which need your OK, and which are never allowed. This builds the permissions block of settings.json using the official rule syntax.
Project scripts
npm run lint
Bash(npm run lint *)npm run test
Bash(npm run test *)npm run build
Bash(npm run build *)npm install
Bash(npm install *)Git
git status
Bash(git status *)git diff
Bash(git diff *)git log
Bash(git log *)git add
Bash(git add *)git commit
Bash(git commit *)git push
Bash(git push *)git reset --hard
Bash(git reset --hard *)Files
Edit files
Editrm -rf
Bash(rm -rf *)Secrets
Read .env
Read(./.env)Read .env.*
Read(./.env.*)Read secrets/
Read(./secrets/**)Web
Web search
WebSearchFetch any web page
WebFetchcurl
Bash(curl *)settings.json
.claude/settings.json
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [
"Bash(npm run lint)",
"Bash(npm run lint *)",
"Bash(npm run test)",
"Bash(npm run test *)",
"Bash(npm run build)",
"Bash(npm run build *)",
"Bash(git status)",
"Bash(git status *)",
"Bash(git diff)",
"Bash(git diff *)",
"Bash(git log)",
"Bash(git log *)",
"Bash(git add)",
"Bash(git add *)",
"WebSearch"
],
"ask": [
"Bash(npm install)",
"Bash(npm install *)",
"Bash(git commit)",
"Bash(git commit *)",
"Bash(git push)",
"Bash(git push *)",
"WebFetch",
"Bash(curl)",
"Bash(curl *)"
],
"deny": [
"Bash(git reset --hard)",
"Bash(git reset --hard *)",
"Bash(rm -rf)",
"Bash(rm -rf *)",
"Read(./.env)",
"Read(./.env.*)"
]
}
}
How to use the file
- Save it as
.claude/settings.json. If that file already exists, merge thepermissionsblock into it. - Restart Claude Code, then run
/permissionsto see the rules it loaded. - Rules are checked deny first, then ask, then allow. The first match wins.
Frequently asked questions
There are three you will use: ~/.claude/settings.json for all your projects, .claude/settings.json in a project to share with your team (commit it), and .claude/settings.local.json for your own project settings that stay out of git. Lists like permissions.allow are combined across files, and project settings beat user settings.
Deny rules are checked first, then ask, then allow. The first match wins, so a deny rule always beats an allow rule for the same command. Anything that matches no rule follows your default mode.
Use Tool or Tool(specifier). Bash(npm run test *) matches any command starting with npm run test. Read(./.env) matches one file, and Read(**/.env) matches .env anywhere. WebFetch(domain:example.com) limits web fetches to one domain. mcp__github__* covers every tool from one MCP server.
default asks before risky actions. acceptEdits auto-accepts file edits and common file commands in your working folder. plan only reads and proposes changes. auto and bypassPermissions can't be set from project files; set them in your user settings or with --permission-mode if you really need them.
Add the commands you trust to permissions.allow, for example your lint, test and build scripts and read-only git commands. Keep risky commands such as git push or rm in ask or deny so you still confirm them.
Yes. Denying Read(./.env) and Read(./.env.*) keeps API keys out of Claude's context. Add any other secret files your project uses.