Skip to content
BENIBIX Learn

Bash Permission Rule

AI⌨️ Claude CodeConfiguration

Also known as Bash(npm run *), Bash rule

A rule like Bash(npm run *) that covers shell commands.

Think of it like

It is like a list on the fridge. It says which jobs you may do without asking.

Example

Jack lets npm test run without a prompt. He denies git push, so nothing leaves his laptop.

Why it matters

Most of Claude's work runs through the shell. These rules decide how often you are asked.

Definition

A Bash permission rule matches the shell commands Claude wants to run. It is written as Bash and the command, such as Bash(npm run *). A star stands for any text. A bare Bash rule covers every command. The rule matches the text Claude writes, so the same program called another way can slip past it.

Example code

json
{
  "permissions": {
    "allow": ["Bash(npm run *)", "Bash(git commit *)"],
    "deny": ["Bash(git push *)"]
  }
}
Run scripts and commits freely, never push.
Each row is one Bash rule.

Common mistake

Trusting a deny rule as a wall. /bin/rm or sh -c 'rm' is not the same text as rm. Use the sandbox for a hard limit.

Key takeaways

  1. 1
    Bash and a command. Bash(npm run *).
  2. 2
    Star is any text. One rule, many commands.
  3. 3
    Text, not program. Not a wall.

Compare