Skip to main content

Permissions Reference

Claude Code uses a permission system to control what actions Claude can take. This reference covers all permission settings.

Permission Modes

Claude Code supports different permission modes that control how much Claude can do without asking:

ModeDescription
DefaultClaude asks permission for each potentially risky action (file edits, commands, etc.)
Plan modeClaude can only read files and search — no edits, no commands
Yolo modeClaude runs all actions without asking (use with caution!)

Tool Permissions

Each tool can be individually configured in the allowlist or denylist.

Built-In Tools

ToolWhat It DoesRisk Level
ReadRead file contentsLow
GlobFind files by name patternLow
GrepSearch file contentsLow
EditModify file contentsMedium
WriteCreate or overwrite filesMedium
BashRun terminal commandsHigh
WebSearchSearch the internetLow
WebFetchFetch content from a URLLow
AgentSpawn a subagent for subtasksMedium

Configuring Tool Permissions

In your settings.json (project or global):

{
"permissions": {
"allow": [
"Read",
"Glob",
"Grep",
"WebSearch",
"WebFetch"
],
"deny": [
"Bash(rm -rf *)",
"Bash(sudo *)"
]
}
}

Allowlist Rules

Allowlist entries auto-approve specific tools or tool+argument patterns:

PatternWhat It Allows
"Read"All file reads without prompting
"Edit"All file edits without prompting
"Bash(npm test)"Only the exact command npm test
"Bash(git *)"Any command starting with git
"Edit(src/**)"Edits only within the src/ directory

Denylist Rules

Denylist entries block specific tools or patterns entirely:

PatternWhat It Blocks
"Bash(rm -rf *)"Any recursive force-delete command
"Bash(sudo *)"Any command using sudo
"Edit(.env*)"Edits to environment files
"Write(*.exe)"Creating executable files

Settings File Locations

ScopeLocation
Global~/.claude/settings.json
Project.claude/settings.json (in project root)

Project settings override global settings. Denylist entries cannot be overridden — if something is denied globally, project settings cannot allow it.

Best Practices

  1. Start restrictive: Begin with default permissions and add allowlist entries as needed
  2. Allowlist read-only tools: Read, Glob, Grep, WebSearch, and WebFetch are safe to auto-approve
  3. Be specific with Bash: Use patterns like Bash(npm test) instead of allowing all Bash commands
  4. Protect sensitive files: Deny edits to .env, credentials, and config files containing secrets
  5. Review before committing: Keep Bash(git commit *) off the allowlist until you trust the workflow