Claude dangerously-skip-permissions: what the flag does
Anthropic’s docs on bypassPermissions mode: what it skips, what it never skips, and where to run it safely.
Short answer
It turns permission prompts off.
The --dangerously-skip-permissions flag starts Claude Code in bypassPermissions mode: tool calls run without asking you, even writes to .git and .claude. Anthropic’s docs say to use it only in an isolated container or VM without internet access, never as root, and point to auto mode if you just want fewer prompts.
6modes
bypassPermissions skips the mostWhere you want to skip permissions in Claude Code
Pick where Claude Code runs. You get what Anthropic’s docs recommend for that place, the command to copy and the checks that still apply.
- 01Recommended: do not pass --dangerously-skip-permissions on your main machine. The docs’ warning says bypass mode belongs in containers, VMs or dev containers without internet access.
- 02Use auto mode instead. A separate classifier model reviews each action and blocks anything beyond your request. From Claude Code v2.1.283 it is the starting mode in the terminal and VS Code; otherwise start it with the command below.
- 03Still too many prompts? Run /sandbox and select auto-allow: sandboxed shell commands then run without asking on macOS, Linux and WSL2.
- 04Add allow rules for the commands you trust, such as Bash(npm run test *), with /permissions or in ~/.claude/settings.json.
If you must run bypass mode on your computer, the docs’ option without Docker is Anthropic’s sandbox runtime, which wraps the whole Claude Code process. Install it with npm install -g @anthropic-ai/sandbox-runtime, configure ~/.srt-settings.json first, then start with srt claude. It is a beta research preview.
- 01Recommended: Anthropic’s dev container. Save the JSON below as .devcontainer/devcontainer.json in your repository, or add its features block to the file you have.
- 02Make sure remoteUser is a non-root account: Claude Code refuses the flag as root. Do not mount ~/.ssh or cloud credential files into the container.
- 03In VS Code, open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P) and run Dev Containers: Rebuild Container. Then run claude in the container terminal and sign in.
- 04Limit outbound traffic, for example with the init-firewall.sh script from Anthropic’s reference container, then start Claude Code with the command below.
The docs warn that a malicious project can still send out anything inside the container, including your Claude Code credentials in ~/.claude, and that Claude can change every file in the mounted workspace, which shows up on your host. Use it with trusted repositories only.
- 01Recommended: an exact allowlist with dontAsk mode. Claude runs only what you list, and anything else is denied instead of waiting for an answer that never comes.
- 02Copy the command below and change the prompt and the tools to your job. It needs no isolation beyond your CI runner, the docs’ setup table says.
- 03For a fully unattended run with every tool, use claude -p with --dangerously-skip-permissions, but only inside a container, a VM or the sandbox runtime, as a non-root user.
- 04In a -p run nobody can answer a prompt, so the few calls that would still prompt in bypass mode are denied.
In non-interactive mode Claude Code shows no warning dialog. Cloud sessions on Anthropic’s servers ignore bypassPermissions from settings files, so a checked-in settings file cannot switch it on there.
What --dangerously-skip-permissions does in Claude Code
Claude Code normally asks before it edits files, runs shell commands or reaches the network. The CLI reference describes --dangerously-skip-permissions in two words, skip permission prompts, and says it is equivalent to --permission-mode bypassPermissions. So the flag is not a separate feature: it starts the session in one of Claude Code’s permission modes, the one Anthropic’s docs label as for isolated containers and VMs only.
In the docs’ words, bypassPermissions mode disables permission prompts and safety checks so tool calls execute immediately. That includes writes to protected paths, which every other mode stops for: .git, .config/git, .vscode, .idea, .husky, .cargo, .devcontainer, .yarn, .mvn and most of .claude. Allow rules have no effect in this mode, because everything is already allowed. The status bar reads bypass permissions on while it is active.
The first time you start an interactive session with the flag, Claude Code shows a warning dialog that asks you to accept responsibility for actions taken without permission checks. Decline and it exits. Accept and it writes skipDangerousModePermissionPrompt: true to ~/.claude/settings.json, so later sessions skip the dialog. Remove that key, or set it to false, to see the dialog again.
What dangerously skip permissions still does not skip
The flag removes prompts, not every guard. The permission modes page, read November 8, 2026, lists actions no mode auto-approves, bypassPermissions included:
- Deny rules. A permissions.deny rule blocks in every mode. This is the one control you keep in bypass mode.
- Ask rules. A tool that matches an explicit ask rule still prompts.
- Dangerous deletes. rm and rmdir aimed at critical paths, such as the filesystem root, top-level folders, your home folder, or your working folder and its parents, still prompt. In bypass mode the terminal prompt shows a two-minute countdown and denies the command if nobody answers.
- Questions for you. The AskUserQuestion tool and MCP tools marked as needing user interaction still wait for an answer.
- Locked folders. Reads or writes outside the working folders when your settings turn on the block for them.
This explains a common complaint, filed more than once as an issue on Anthropic’s claude-code repository on GitHub: the flag still asks for confirmation. A critical-path rm or an ask rule is the usual reason. The docs name an environment variable, CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1, that removes even the critical-path prompt, from Claude Code v2.1.311. They warn that with it a command such as rm -rf ~ can run without asking, so it belongs only in an environment you can afford to lose.
Claude Code permission modes compared
Each mode trades convenience for oversight. Checked November 8, 2026, on the Claude Code docs:
| Mode | Runs without asking | Best for |
|---|---|---|
| default (Manual) | Reads only | Sensitive work |
| accept | Reads, file edits, mkdir, mv, cp and similar | Code you review after |
| plan | Reads; edits wait for your plan approval | Exploring first |
| auto | Everything, with a safety classifier | Long tasks |
| dont | Reads and pre-approved tools; the rest is denied | Locked-down CI |
| bypass | Everything | Isolated containers and VMs |
Auto mode is the one Anthropic recommends when the goal is fewer prompts: the bypass section of the docs says bypassPermissions offers no protection against prompt injection or unintended actions and points to auto mode for background safety checks. Auto mode needs a supported model, such as Claude Opus 4.6 or Sonnet 4.6 or later on the Anthropic API, and Team and Enterprise admins can turn it off.
How to start Claude with dangerously-skip-permissions
You cannot switch into bypassPermissions from a session that started without it. Enable it at launch in one of these ways:
- The flag. claude --dangerously-skip-permissions, or the long form claude --permission-mode bypassPermissions.
- Bypass later. claude --allow-dangerously-skip-permissions adds bypass to the Shift+Tab cycle without starting in it, for example after plan mode: claude --permission-mode plan --allow-dangerously-skip-permissions.
- settings.json. Set permissions.defaultMode to bypassPermissions in ~/.claude/settings.json, in a file passed with --settings or in managed settings. Since v2.1.257 the value does not take effect from a project’s .claude/settings.json or .claude/settings.local.json; the session starts in Manual mode instead.
- VS Code extension. Turn on Allow dangerously skip permissions in the extension settings, then pick Bypass permissions from the mode indicator under the prompt box.
- Claude Desktop. In the Code tab, turn on Allow bypass permissions mode in Desktop settings on Pro, Max and Ultra; on Team and Enterprise, organization policy decides.
During a session, Shift+Tab cycles default, acceptEdits and plan; bypassPermissions appears after plan only if you enabled it at launch. To make bypass mode your default in settings.json, the file looks like this: { “permissions”: { “defaultMode”: “bypassPermissions” } }.
Is dangerously skip permissions safe? Anthropic’s warnings
The flag’s name is the first warning. The docs add four specific ones:
- Isolation only. Only use this mode in isolated environments like containers, VMs or dev containers without internet access, where Claude Code cannot damage your host system.
- Prompt injection. bypassPermissions offers no protection against prompt injection or unintended actions. Text Claude reads in a file or a web page can steer what it runs, and nothing stops the command.
- Data leaks. With the flag, a dev container does not stop a malicious project from sending out anything inside the container, including the Claude Code credentials in ~/.claude.
- Your files. Claude can still change any file in the mounted workspace, and those edits appear on your host.
Anthropic’s sandbox environments page sums it up: with no prompts to catch mistakes, the isolation boundary you choose is what protects your system. It asks you to always run these sessions inside a container, a VM or the sandbox runtime, so file tools, MCP servers and hooks sit inside the boundary too. The built-in Bash sandbox alone is not enough, because it covers only shell commands.
Run dangerously skip permissions in a devcontainer or Docker
Anthropic’s Development containers page is the documented route. The container runs Claude Code as a non-root user and keeps commands inside the container, so it supports the flag for unattended work. The steps, which the tool above sets out with the config to copy:
- 01Add the Claude Code Dev Container Feature, ghcr.io/anthropics/devcontainer-features/claude-code:1.0, to .devcontainer/devcontainer.json. The tag pins the install script; the feature installs the latest Claude Code.
- 02Set remoteUser to a non-root account and rebuild the container.
- 03Restrict network egress to the domains Claude Code needs. Anthropic’s reference container uses a default-deny firewall script, init-firewall.sh, with the NET_ADMIN and NET_RAW capabilities.
- 04To keep your sign-in across rebuilds, mount a named volume at ~/.claude and set CLAUDE_CONFIG_DIR to the same path.
For your own Docker or OCI image, the docs’ checklist is the same: review what is mounted writable, which credentials and tokens are reachable inside, and what the egress policy allows. A dedicated VM gives the strongest separation and is the docs’ choice for untrusted repositories. Docker Sandboxes, a free microVM product from Docker, is listed as one way to get that.
Claude --dangerously-skip-permissions not working: causes from the docs
- Cannot be used with root/sudo privileges for security reasons. On Linux and macOS, Claude Code refuses bypass mode as root or under sudo. Run as a normal user; the docs’ dev container already does. The check is skipped inside a recognized sandbox.
- Set in project settings. defaultMode: bypassPermissions in .claude/settings.json or .claude/settings.local.json is ignored, and the session starts in Manual mode. Move it to ~/.claude/settings.json or use the flag.
- Blocked by your organization. Managed settings with disableBypassPermissionsMode make Claude Code reject the flag.
- Restricted mode. A session started with --restricted refuses bypassPermissions.
- Background sessions. claude --bg with bypass mode is refused until you accept the warning once in an interactive session, so that the key lands in ~/.claude/settings.json.
- Not in the VS Code menu. Turn on the Allow dangerously skip permissions toggle in the extension settings.
- Claude Code on the web. Cloud sessions offer Accept edits, Plan and Auto; Bypass permissions is not available there.
If a problem started for everyone at once, check the service before your settings.
5Disable bypass permissions mode for your team
Admins can block the mode with one key. Set permissions.disableBypassPermissionsMode to “disable” in managed settings: { “permissions”: { “disableBypassPermissionsMode”: “disable” } }. The settings reference says Claude Code then rejects --dangerously-skip-permissions, and a subagent whose definition asks for bypassPermissions runs with the parent session’s mode instead. The key is a lock, so the strictest value from any settings source wins.
Deliver it through server-managed settings or your device management tool. On Linux, Claude Code also reads /etc/claude-code/managed-settings.json at the highest precedence, but the dev container page notes that anyone with write access to the repository can change a Dockerfile that copies it in. To remove auto mode as well, the matching key is permissions.disableAutoMode.
Safer alternatives to skipping permissions
- Auto mode. Hands-off work with a classifier that blocks actions beyond your request, unrecognized infrastructure and moves driven by hostile content. Anthropic still warns it does not guarantee safety.
- acceptEdits. File edits and common file commands in your working folder run without asking; other shell commands still prompt. Press Shift+Tab once from Manual mode.
- Allow rules. Pre-approve exact commands in settings.json, such as Bash(npm run lint), and deny what must never run, such as Read(./.env). Rules are checked in the order deny, then ask, then allow, and /permissions lists every rule with the file it comes from.
- The Bash sandbox. Run /sandbox and pick auto-allow: commands run without prompts inside filesystem and network limits, while deny rules still apply.
- dontAsk for scripts. Only pre-approved tools run, and the session never waits for input.
FAQ
What is the Claude dangerously-skip-permissions command?
claude --dangerously-skip-permissions. It starts Claude Code in bypassPermissions mode, the same as claude --permission-mode bypassPermissions. Add -p and a prompt for a one-shot run.
Can I set dangerously-skip-permissions in settings.json?
Yes, as permissions.defaultMode set to bypassPermissions in ~/.claude/settings.json or managed settings. Since v2.1.257 a project’s .claude/settings.json cannot turn it on.
Why does it say it cannot be used with root/sudo privileges?
Claude Code refuses bypass mode as root on Linux and macOS. Run it as a normal user, for example in the docs’ dev container, which uses a non-root account.
How do I use dangerously-skip-permissions in VS Code?
Turn on Allow dangerously skip permissions in the Claude Code extension settings, then choose Bypass permissions from the mode indicator. In the VS Code terminal, the CLI flag works as usual.
Why does Claude still ask for permission with the flag?
Some actions prompt in every mode: ask rules, rm on critical paths such as your home folder, and tools that need your answer. Deny rules also still block.
Is dangerously-skip-permissions safe?
Only inside isolation. Anthropic says it offers no protection against prompt injection and should run in a container or VM without internet access, never on the machine you work on.
Does it work in Claude Code on the web?
No. Cloud sessions offer Accept edits, Plan and Auto, and ignore bypassPermissions in settings files. They already run in an isolated VM that Anthropic manages.
Sources
- Anthropic, Claude Code Docs, Choose a permission mode, read November 8, 2026
- Anthropic, Claude Code Docs, Configure permissions, read November 8, 2026
- Anthropic, Claude Code Docs, CLI reference, read November 8, 2026
- Anthropic, Claude Code Docs, Settings and Settings reference, read November 8, 2026
- Anthropic, Claude Code Docs, Development containers, read November 8, 2026
- Anthropic, Claude Code Docs, Choose a sandbox environment, and Sandboxing, read November 8, 2026
- Anthropic, Claude Code Docs, Security, and Server-managed settings, read November 8, 2026
- Anthropic, claude-code issue tracker on GitHub, reports that the flag still prompts, read November 8, 2026
Spotted a flag or setting that no longer matches? Write to support@gptx.io and we will check it.
Next up8 minClaude Skills in Claude Code4What a SKILL.md is, how to add a skill and the four document skills Anthropic ships.