Learn how to configure user authentication, authorization, and access controls for Claude Code in your organization.
Tool Type | Example | Approval Required | ”Yes, don’t ask again” Behavior |
---|---|---|---|
Read-only | File reads, LS, Grep | No | N/A |
Bash Commands | Shell execution | Yes | Permanently per project directory and command |
File Modification | Edit/write files | Yes | Until session end |
/permissions
. This UI lists all permission rules and the settings.json file they are sourced from.
Tool
or Tool(optional-specifier)
A rule that is just the tool name matches any use of that tool. For example, adding Bash
to the list of allow rules would allow Claude Code to use the Bash tool without requiring user approval.
defaultMode
in settings files:
Mode | Description |
---|---|
default | Standard behavior - prompts for permission on first use of each tool |
acceptEdits | Automatically accepts file edit permissions for the session |
plan | Plan Mode - Claude can analyze but not modify files or execute commands |
bypassPermissions | Skips all permission prompts (requires safe environment - see warning below) |
--add-dir <path>
CLI argument/add-dir
slash commandadditionalDirectories
in settings filesBash(npm run build)
Matches the exact Bash command npm run build
Bash(npm run test:*)
Matches Bash commands starting with npm run test
Bash(curl http://site.com/:*)
Matches curl commands that start with exactly curl http://site.com/
&&
) so a prefix match rule like Bash(safe-cmd:*)
won’t give it permission to run the command safe-cmd && other-cmd
:*
only works at the end of a pattern to match any continuationBash(curl http://github.com/:*)
can be bypassed in many ways:
curl -X GET http://github.com/...
won’t matchcurl https://github.com/...
won’t matchcurl -L http://bit.ly/xyz
(redirects to github)URL=http://github.com && curl $URL
won’t matchcurl http://github.com
won’t matchWebFetch(domain:github.com)
permissionEdit
rules apply to all built-in tools that edit files. Claude will make a best-effort attempt to apply Read
rules to all built-in tools that read files like Grep, Glob, and LS.
Read & Edit rules both follow the gitignore specification with four distinct pattern types:
Pattern | Meaning | Example | Matches |
---|---|---|---|
//path | Absolute path from filesystem root | Read(//Users/alice/secrets/**) | /Users/alice/secrets/** |
~/path | Path from home directory | Read(~/Documents/*.pdf) | /Users/alice/Documents/*.pdf |
/path | Path relative to settings file | Edit(/src/**/*.ts) | <settings file path>/src/**/*.ts |
path or ./path | Path relative to current directory | Read(*.env) | <cwd>/*.env |
/Users/alice/file
is NOT an absolute path - it’s relative to your settings file! Use //Users/alice/file
for absolute paths.Edit(/docs/**)
- Edits in <project>/docs/
(NOT /docs/
!)Read(~/.zshrc)
- Reads your home directory’s .zshrc
Edit(//tmp/scratch.txt)
- Edits the absolute path /tmp/scratch.txt
Read(src/**)
- Reads from <current-directory>/src/
WebFetch(domain:example.com)
Matches fetch requests to example.commcp__puppeteer
Matches any tool provided by the puppeteer
server (name configured in Claude Code)mcp__puppeteer__puppeteer_navigate
Matches the puppeteer_navigate
tool provided by the puppeteer
server*
).To approve all tools from an MCP server:mcp__github
(approves ALL GitHub tools)mcp__github__*
(wildcards are not supported)mcp__github__get_issue
mcp__github__list_issues
/Library/Application Support/ClaudeCode/managed-settings.json
/etc/claude-code/managed-settings.json
C:\ProgramData\ClaudeCode\managed-settings.json
.claude/settings.local.json
).claude/settings.json
)~/.claude/settings.json
)apiKeyHelper
setting can be configured to run a shell script that returns an API key.apiKeyHelper
is called after 5 minutes or on HTTP 401 response. Set CLAUDE_CODE_API_KEY_HELPER_TTL_MS
environment variable for custom refresh intervals.