Allow npm test commands
Allow matching npm test commands through Bash.
"allow": ["Bash(npm run test:*)"]
Build a Claude Code settings.json permissions block with allow, ask and deny rules and an optional defaultMode. Add tools such as Bash, Read, Edit, WebFetch or MCP tools, then copy the JSON. Everything runs locally in your browser, with no account or network connection.
allow: Bash(npm run test:*)Claude Code checks deny, then ask, then allow. The first match decides, regardless of rule specificity.
{
"permissions": {
"allow": [
"Bash(npm run test:*)"
]
}
}
~/.claude/settings.json applies to all your projects on this computer..claude/settings.json applies to one project..claude/settings.local.json applies only to your local copy of one project.Merge this block with your existing settings instead of replacing other configuration. Project and local settings ignore auto and bypassPermissions as starting modes. Read the Claude Code permission modes guide for the fallback behavior and rule precedence.
Allow matching npm test commands through Bash.
"allow": ["Bash(npm run test:*)"]
Deny Read calls for the .env path. A Read deny also blocks Edit and Write on the same path. The Write check needs v2.1.228 or later.
"deny": ["Read(./.env)"]
Require a permission decision before matching git push commands.
"ask": ["Bash(git push *)"]
Review each rule before using it. For Bash, * stands for any text. Read and Edit rules use gitignore pattern syntax.