src/hooks/toolPermission/ and either prompts you interactively, auto-approves, or rejects the call — depending on your configured permission mode and any allow/deny rules you have set up.
Permission modes
Claude Code supports five permission modes. You set the mode via the--permission-mode flag or in your settings file.
- default
- acceptEdits
- plan
- bypassPermissions
- dontAsk
Prompts you for each tool call that is not already covered by an allow or deny rule.This is the standard interactive mode. For each new tool invocation, Claude Code pauses and shows you what it wants to do. You can:
- Allow once — approve this single call
- Allow always — add a permanent allow rule for this tool/pattern
- Deny — reject this call and tell Claude why
Allow and deny rules
You can pre-configure which tools are always allowed or always denied using rules in your settings. Rules are checked before the interactive prompt, so Claude can proceed without stopping.Rule syntax
Rules use a pattern syntax:ToolName or ToolName(pattern).
Pattern syntax
| Pattern | Matches |
|---|---|
Read | Any call to FileReadTool, regardless of arguments |
Bash(git *) | Any BashTool call whose command starts with git |
Read(*.ts) | Any FileReadTool call on a .ts file |
Bash(npm run test) | Exactly the command npm run test |
* matches any string, including slashes in file paths).
Deny rules take precedence over allow rules. If a tool call matches both an allow rule and a deny rule, it is denied.
Trust levels
The permission system has three trust levels, evaluated in order:- Denied tools — match a deny rule → rejected immediately, no prompt
- Approved tools — match an allow rule → approved immediately, no prompt
- Ask — no rule matches → interactive prompt (or auto-deny in non-interactive mode)
BashTool calls may go through an async classifier check that runs in the background while the prompt is shown. If the classifier auto-approves a low-risk command (e.g., git status), the prompt is dismissed automatically.
Plan mode in detail
Plan mode gives you full oversight before any side effect occurs. When Claude enters plan mode:- Claude calls
EnterPlanModeTool(this tool itself is always allowed). - Claude describes every subsequent action it plans to take, in order.
- No tools execute while Claude is in plan mode — it can only read and reason.
- You review the plan and reply with approval, modifications, or rejection.
- Claude calls
ExitPlanModeTooland begins executing the approved plan.
Configuring permissions
Permissions are configured in your settings file. Settings are layered: policy settings override local settings, which override user settings.Project-level settings (
.claude/settings.json) are merged with user-level settings. Project settings can only add allow rules — they cannot override deny rules set at the user or policy level.Related pages
Tool system
How tools are defined and what permission levels they declare.
Configuration
Full settings reference, including permission configuration.
Headless mode
Running Claude Code non-interactively in CI pipelines.
Hooks
Intercept tool calls programmatically with hooks.