Claude Code permissions: rules, modes and the dangerously skip permissions flag
Claude Code checks every action against permission rules and a permission mode, and the program enforces both, not the model. The Claude Code --dangerously-skip-permissions flag is the same as the bypassPermissions mode. It removes the approval prompt, and protected path checks are skipped too. The docs limit it to isolated environments. Deny rules still hold in every mode. On the Mac you work on every day, stay in manual or auto mode and add allow rules for commands you trust.
Claude Code runs shell commands, edits files and calls tools for you. Permissions decide which of those happen silently and which wait for your yes. Below: how rules and modes fit together, what each mode does, which setting wins and what the Claude Code dangerously skip permissions option removes. Then how to get fewer prompts without giving up the safety net.
01Rules plus a mode
Two things work together. Rules say what is allowed, asked about or denied. The mode sets the default for everything the rules do not cover. Instructions in your prompt or in CLAUDE.md shape what Claude tries to do, but permission rules decide what Claude Code allows.
02Allow, ask and deny rules
Allow runs an action without a prompt, ask forces a prompt, and deny blocks it. Rules are checked in a fixed order, deny first, then ask, then allow, and the first match decides. A more specific rule does not change that order.
Two consequences follow. A broad deny rule such as Bash(aws *) blocks every matching call, even one that also matches a narrower allow rule like Bash(aws s3 ls). An allow rule cannot carve an exception out of a deny rule. A matching ask rule prompts even when a more specific allow rule matches.
A rule names a tool and, optionally, a target in brackets. The patterns that matter most for Bash:
| Rule | What it matches |
|---|---|
Bash(npm run build) | exactly the command npm run build |
Bash(npm run *) | npm run build and npm run test --watch, but not npm install |
Read(./.env) | reading the .env file in the current directory |
Before matching, Claude Code strips a fixed set of wrappers, so Bash(npm test *) also matches timeout 30 npm test. Put Read(./.env) in a deny list and every read that rule matches is blocked. The section on limits below shows what such a rule misses.
03Which setting wins
You can set rules in more than one settings file. If user settings allow something and project settings deny it, the deny blocks it, and a user-level deny blocks a project-level allow. If a tool is denied at any level, no other level can allow it. Managed settings, the file an administrator controls, rank highest: no other level, even command line arguments, can override a managed permission rule. An admin can also switch off bypass or auto mode by setting permissions.disableBypassPermissionsMode or permissions.disableAutoMode to "disable".
04The six permission modes
The mode is the default for anything no rule matches. Manual mode is called Manual in the CLI, the VS Code and JetBrains extensions and the desktop app. Its config value is default.
| Mode | What runs without asking | Docs say it fits |
|---|---|---|
default (Manual) | Reads only | Reviewing every action yourself, sensitive work |
acceptEdits | Reads, file edits and common filesystem commands such as mkdir, touch, mv, cp | Iterating on code you're reviewing |
plan | Claude reads files and runs read-only shell commands but does not edit your source files; with auto mode available, classifier-approved commands also run | Exploring before changing anything |
auto | Everything, with background safety checks | Long tasks, reducing prompt fatigue |
dontAsk | Anything that would prompt is denied | Locked-down CI and scripts |
bypassPermissions | Everything, except actions no mode auto-approves | Isolated containers and VMs only |
The risk grows down the table, except dontAsk and plan, which refuse instead of allowing. To start a session in plan mode: claude --permission-mode plan. For CI there is an example with an exact allowlist: claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read". What auto mode blocks and allows is on its own page: Claude Code auto mode.
Switch modes in the CLI with Shift+Tab, in VS Code with the mode indicator, in Desktop with the mode selector.
05How the starting mode is chosen
A session picks its mode in this order: first the --permission-mode flag or --dangerously-skip-permissions, then permissions.defaultMode in a settings file. With no setting, Claude Code v2.1.283 or later starts interactive terminal and VS Code sessions in auto mode.
One trap: bypassPermissions set in a project's .claude/settings.json or settings.local.json does not take effect, and the session starts in Manual mode. An older advisory described a version where a repository could do this and skip the trust dialog. The advisory list is on the Claude Code security page.
06Why Claude Code keeps asking
In manual mode it asks because that is the design. Bash commands need approval except a built-in set of read-only ones, and file edits need approval too. A prompt is not a sign that something is wrong. GitHub makes the same point about its own agent: permission prompts are a key safety mechanism for local agentic execution.
Read what you approve. An approved Bash command can write anywhere your user account can. Approving npm test is fine. Approving a long command you did not read is the real risk.
07How to get fewer prompts
Wanting Claude Code to allow all commands is the usual reason people reach for the flag. Four milder moves, in order:
- Choose Yes, and don't ask again on a command you trust. Claude Code saves the rule to
.claude/settings.local.jsonat the root of the git repository and it applies to future sessions anywhere in that repository. For file edits the choice lasts only until the session ends. - Write allow rules for the routine commands of your project and deny rules for secrets. Allow the dozen commands you actually use, not every command.
- Switch to
acceptEditsorautofor a long task you understand. - Turn on the sandbox, an operating system boundary around shell commands, and see Claude Code sandbox.
A hook is a script of yours that Claude Code runs before a tool call and that can veto it, even in bypassPermissions. A hook that exits with code 2 stops the call before permission rules are evaluated. Mechanics and examples: Claude Code hooks.
08What the --dangerously-skip-permissions flag changes
With the Claude Code --dangerously-skip-permissions flag on, the prompt is replaced with nothing and protected-path checks are skipped, including writes to .git and .claude. Allow rules stop mattering. What survives is deny rules, a deny decision from a hook and the short list of actions no mode auto-approves.
If bypass permissions are not working, check three things. A deny rule may match. An admin may have set permissions.disableBypassPermissionsMode in managed settings. Or you launched it as root, the system administrator account, which the CLI refuses. Containers and the rest of the flag's story are on the dedicated page.
09Rules are not a wall
A long deny list feels like cover. Treat it as a strong guard against honest mistakes, not as a wall against a prompt-injected agent. That is an agent that read text planted in a web page or file and treated it as instructions. The docs show where rules leak:
- A deny rule does not match the same program by path or inside
sh -c. When the restriction must hold, pair it with the sandbox network allowlist, a list of servers the sandbox may reach. - A WebFetch rule alone does not stop network access. If Bash is allowed, Claude can still use curl, wget or other tools to reach any URL.
- Two published advisories, CVE-2025-55284 and CVE-2026-24887 (public numbers for security holes), showed approval prompts bypassed. One went through an overly broad allowlist of safe commands, the other through command injection in
find.
10What to take away
Claude Code permissions are rules plus a mode, and the program enforces both. The Claude Code --dangerously-skip-permissions flag sits at the far end of that scale: no prompt, allow rules ignored, deny rules and hook denies still standing. For daily work keep manual or auto mode, save the commands you trust, and keep deny rules on your secrets. Compare the same switches across four agents on the agent permissions overview, read the slang explained in Claude Code YOLO mode, or go back to the home page.
FAQ
What do bypass permissions do in Claude Code?
They remove the approval prompt; a few actions that no mode auto-approves still apply. The mode is meant for isolated containers and VMs only. Allow rules have no effect there, but deny rules still block.
Why does Claude Code keep asking for permission?
In manual mode it asks before Bash commands, except a built-in set of read-only ones, and before file edits. Pick Yes, and don't ask again to save a rule, or switch the mode with Shift+Tab.
How do I let Claude Code allow everything without asking?
The mode that asks about nothing is bypassPermissions, and the --dangerously-skip-permissions flag is equivalent to it. Use it only inside a container or VM; for daily work write allow rules for the commands you trust instead.
Why are bypass permissions not working in Claude Code?
A deny rule still blocks in every mode. bypassPermissions set in project .claude/settings.json or settings.local.json does not take effect, an admin can forbid the flag with permissions.disableBypassPermissionsMode, and the CLI refuses it as root.
How do I bypass permissions in the VS Code extension or Claude desktop?
VS Code has a mode indicator and Desktop a mode selector for switching modes, and the desktop app applies permissions.defaultMode to new local sessions. You cannot enter bypassPermissions from a session started without it.
Can Claude Code access all files?
The working directory boundary is a permission prompt, so a Bash command you approve can write anywhere your user account can. Reads inside the working directory need no approval.
Does a CLAUDE.md instruction change what is allowed?
No. CLAUDE.md shapes what Claude tries to do; permission rules decide what is allowed.