What permissions control
Every tool invocation goes through a permission check before executing. The check result is one of:- allow — the operation proceeds without prompting
- ask — Claude pauses and asks you to approve or deny
- deny — the operation is blocked
Bash, FileEdit, FileRead, WebFetch) and can be scoped to specific command prefixes or patterns within a tool.
Permission modes
The active permission mode determines the default behavior when no explicit allow/deny rule matches.| Mode | Behavior |
|---|---|
default | Claude prompts for approval on potentially impactful tool use |
acceptEdits | File edits are auto-accepted; other tools still prompt |
plan | Claude explains what it intends to do, but does not execute tools |
bypassPermissions | All tools are allowed without prompting |
dontAsk | All tools are allowed without prompting |
Setting the default mode
Setpermissions.defaultMode in any settings file to establish a default for that scope:
.claude/settings.json
The --permission-mode flag
Override the permission mode for a single session at launch:
Interactive approval
When Claude needs to use a tool and no rule covers it, it pauses and shows you what it wants to do. You can:- Approve once — allow this specific invocation
- Approve always — add a permanent allow rule for this tool or command
- Deny — block this invocation
- Deny always — add a permanent deny rule
The claude permissions command
Run /permissions (also aliased as /allowed-tools) inside a session to open the interactive permission rule manager. This UI lets you view, add, and remove allow/deny/ask rules across all settings sources without manually editing JSON files.
Allow and deny rules in settings
Addpermissions.allow and permissions.deny arrays to any settings file to create persistent rules.
Rule format
Rules are strings in the formToolName or ToolName(pattern):
Bash— matches all Bash invocationsBash(git:*)— matches any Bash command starting withgitFileEdit— matches all file edit operationsFileRead(src/*)— matches file reads undersrc/
.claude/settings.json
Rule sources and precedence
Rules are loaded from all active settings sources and merged. The source of a rule is tracked for display in the UI:| Source | Display name |
|---|---|
userSettings | User settings |
projectSettings | Shared project settings |
localSettings | Project local settings |
flagSettings | Command line arguments |
policySettings | Enterprise managed settings |
allowManagedPermissionRulesOnly
When set to true in managed settings, only permission rules from managed settings are respected. User, project, local, and CLI argument rules are ignored. This is an enterprise policy option.
Directory access
By default, Claude Code can read and write files within the current working directory. Usepermissions.additionalDirectories to grant access to directories outside the working directory:
Managed settings can also supply
additionalDirectories to pre-grant access to shared locations for all users in an organization.Sandbox mode
When theCLAUDE_CODE_USE_SANDBOX environment variable is set, the Bash tool runs inside a sandbox runtime provided by @anthropic-ai/sandbox-runtime. The sandbox imposes configurable filesystem and network restrictions on shell commands.
sandbox key. The sandbox adapter integrates with Claude Code’s settings system and supports the same per-source configuration as other settings.
Enterprise policy limits
Enterprise administrators can restrict the permission system through managed settings:disableBypassPermissionsMode
disableBypassPermissionsMode
Prevent users from entering
bypassPermissions mode. Set to "disable" in managed settings.managed-settings.json
allowManagedPermissionRulesOnly
allowManagedPermissionRulesOnly
When
true, only permission rules defined in managed settings are applied. All user- and project-level rules are ignored.managed-settings.json
Managed allow/deny rules
Managed allow/deny rules
Place allow and deny rules directly in managed settings to enforce organization-wide tool policy. These rules merge with the managed permission rule set.
managed-settings.json