Permissions Overview
Permissions decide which tool calls Claude Code may run, which need a prompt, and which it must refuse.
The sandbox adds a second wall around Bash commands, enforced by the operating system.
For example, an allow rule for Bash(bun test) runs the tests with no prompt. The sandbox still limits what that command can reach.
Permissions are always on. You see them as prompts, or as silent allows and denies. You cannot remove them.
Set them with the permissions, sandbox, and autoMode keys in settings files, and with CLI flags.
You can loosen them with bypassPermissions. You can lock them down with dontAsk, --restricted, or managed settings.
Pages in This Section
| Page | What it covers |
|---|---|
| Permission Modes | The six modes, how Claude Code chooses a mode, decision reasons, and safety checks. |
| Permission Rules | Rule syntax, the permissions. keys, related flags and hooks, and permission updates. |
| Sandbox | Every sandbox. key and its environment variables. |
| Auto Mode | The classifier, the auto setting, and the claude auto- commands. |
| Auto Mode Default Rules | Each default allow, hard deny, environment, and soft deny rule. |
| Permission Flow | The order in which Claude Code applies all of the above. |
Example
{
"permissions": {
"defaultMode": "default",
"allow": ["Bash(bun test)", "Read(src/**)"],
"deny": ["Bash(git push:*)"]
},
"sandbox": { "enabled": true }
}
bun test runs without a prompt. The deny rule blocks git push. Other commands prompt you. Bash runs in the sandbox.
Marks and Sources
Official pages: Configure Permissions, Choose a Permission Mode, Configure Auto Mode, and Configure the Sandboxed Bash Tool. Badges follow How to Read These Docs.
Related Pages
- Settings Files and Scopes explains the scopes and the order of settings files.
- All Flags lists
--permission-mode,--allowedTools, and the others. - Output Styles and Memory and Rules shape behavior, but do not enforce it.