Skip to main content

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​

PageWhat it covers
Permission ModesThe six modes, how Claude Code chooses a mode, decision reasons, and safety checks.
Permission RulesRule syntax, the permissions.* keys, related flags and hooks, and permission updates.
SandboxEvery sandbox.* key and its environment variables.
Auto ModeThe classifier, the autoMode setting, and the claude auto-mode commands.
Auto Mode Default RulesEach default allow, hard deny, environment, and soft deny rule.
Permission FlowThe order in which Claude Code applies all of the above.

Example​

.claude/settings.json
{
"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.