excludedCommands vs Bash Permission Rule
People think putting a command in excludedCommands lets it run without asking. It does not. The list only takes a command out of the sandbox, so it runs with your full access. It still goes through your rules and your mode. In Manual mode, it still needs a Bash allow rule to skip the prompt.
sandbox.excludedCommands
A list of commands that run outside the sandbox.
sandbox.excludedCommands is a settings key that names commands to run with no fence, such as tools that break in the sandbox. Each entry is written like a Bash rule: an exact command, or a start such as docker *. An entry must match each command in a call. Commands that start with sudo, eval or xargs stay fenced.
Bash Permission Rule
A rule like Bash(npm run *) that covers shell commands.
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.
In one line
- sandbox.excludedCommands
- A list of commands that run outside the sandbox.
- Bash Permission Rule
- A rule like Bash(npm run *) that covers shell commands.