Skip to content
BENIBIX Learn

Bash Permission Rule vs Sandbox

People think a Bash deny rule is a wall around a program. It is a check on the text Claude writes. Bash(rm *) stops rm, but not /bin/rm or sh -c 'rm'. The sandbox works lower down. It limits which files and hosts any command can reach, however it is spelled. Use rules to cut prompts, and the sandbox for a hard limit.

AI⌨️ Claude Code

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.

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.
Full entry
AI⌨️ Claude Code

Claude Code Sandbox

A wall that keeps Claude's shell commands in set folders and sites.

The Claude Code sandbox runs the shell commands Claude starts inside a wall set by your computer's system. You choose up front which folders they may write to and which sites they may reach. Inside that wall, commands can run without asking, since they cannot reach anything else. It is off at first, and you turn it on with /sandbox. It is a separate layer from permission rules, and the two work together.

Example
Emma turns on the sandbox. Now Claude can run build scripts without prompts, and a script that tries to read her home folder is simply blocked.
Why it matters
It cuts prompts and adds safety at the same time, because the walls do the checking.
Full entry

In one line

Bash Permission Rule
A rule like Bash(npm run *) that covers shell commands.
Claude Code Sandbox
A wall that keeps Claude's shell commands in set folders and sites.