Omniscio

OmniscioGuidesClaude Code --dangerously-skip-permissions

Claude Code --dangerously-skip-permissions explained

The flag has an alarming name and one clear job: it stops Claude Code asking before it acts. That is useful when the session runs inside a container that cannot hurt anything else, and risky everywhere else.

The flag is shorthand for --permission-mode bypassPermissions. It removes the questions, except for a short list that still stops a call, and Anthropic's own advice is to use it only inside a container or a virtual machine.

Last checked against Anthropic's Claude Code documentation on November 18, 2026. By the Omniscio team. Updated .

What the flag turns off

The flag is a shorthand. Anthropic's CLI reference says --dangerously-skip-permissions skips permission prompts and is equivalent to --permission-mode bypassPermissions. A session started with it begins in that mode.

In that mode Claude Code stops asking. Anthropic's wording is that it disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths such as .git and .claude.

Nothing takes the prompt's place. Anthropic's own comparison table answers the question of what replaces it in this mode with one word: Nothing. Protected-path checks are skipped along with the questions, and the short list in the next section is what still stops a call.

The permission modes guide covers all six modes side by side, including the two that prompt less without removing every check.

Sources: the --dangerously-skip-permissions row in the CLI reference and "Skip all checks with bypassPermissions mode" in permission modes, read November 18, 2026.

What still blocks it

It is not a licence to do anything. Anthropic lists a set of actions that no mode auto-approves, and bypass mode is no exception. Each gets a prompt or a denial.

  • Tools matched by an explicit ask rule, meaning a tool you have told Claude Code to always ask about.
  • Tools that need a person, such as AskUserQuestion and MCP tools marked requiresUserInteraction.
  • Recognized rm and rmdir removals of a critical path.
  • Bash commands flagged Dangerous rm operation not ruled out.
  • Reads and writes outside the working directories, when the matching blockReadsOutsideWorkingDirectories or blockWritesOutsideWorkingDirectories key is on.

The critical-path check is the one people are surprised by. No allow rule and no PreToolUse hook (an automated check that can approve tool calls in advance) can approve such a removal, and the mode does not approve it either.

One prompt in that list can be silenced. Anthropic documents starting Claude Code with CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1 to remove the prompt for dangerous rm commands in bypass mode, and warns on the same page that a command such as rm -rf ~ can then run without asking you.

Sources: "Actions no mode auto-approves" and "Critical paths" in permission modes, read November 18, 2026.

Root, sudo and restricted sessions

On Linux and macOS, Claude Code refuses to start in bypass mode when it runs as root or under sudo. Anthropic gives the message it prints: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons.

The refusal has one exception. The check is skipped automatically inside a recognized sandbox, on the reasoning that the isolation is doing the work root would otherwise do.

Claude Code also refuses bypassPermissions in a session you start with --restricted.

Source: "Skip all checks with bypassPermissions mode" in permission modes, read November 18, 2026.

The three ways into the mode

You cannot talk a session into it later. Anthropic's rule is that you cannot enter bypass mode from a session you started without it enabled, so it has to be turned on at launch. There are three ways to do that.

  1. The flag at launch. claude --dangerously-skip-permissions, or its equivalent claude --permission-mode bypassPermissions. The session starts in bypass mode.
  2. Allow it, then cycle to it. claude --permission-mode plan --allow-dangerously-skip-permissions starts in plan mode and adds bypass mode to the Shift+Tab cycle without activating it.
  3. The setting. permissions.defaultMode set to "bypassPermissions" in user settings, a --settings file, or managed settings.

The cycle order is worth knowing. Enabled optional modes slot in after plan, with bypass first and auto last, so a session with both enabled passes through bypass on the way to auto.

The first interactive start shows a warning dialog asking you to accept responsibility. Accepting records skipDangerousModePermissionPrompt in your user settings; declining exits. No dialog appears in non-interactive runs.

Sources: the --allow-dangerously-skip-permissions row in the CLI reference and "Skip all checks with bypassPermissions mode" in permission modes, read November 18, 2026.

Where it is refused or ignored

The setting does not work everywhere the other modes do. Anthropic's table for where to set a default mode says terminal sessions in one project honour every value except auto and bypassPermissions.

Set it in a project settings file and it does not take effect: Anthropic says the session starts in Manual mode instead. Put it in your user settings, a --settings file, or managed settings.

Cloud sessions ignore it too. Anthropic says a cloud session does not honour defaultMode set to bypassPermissions or dontAsk from your settings files, so a checked-in file cannot start one that way.

Background sessions have their own rule: claude --bg is refused in this mode until the dialog has been accepted once in an interactive session.

Sources: "Skip all checks with bypassPermissions mode", "Which mode a session starts in" and the -p table in permission modes, read November 18, 2026.

When it is genuinely used

Anthropic's warning is not subtle: only use this mode in isolated environments like containers, VMs or dev containers without internet access, where Claude Code cannot damage your host system. That is the whole legitimate case.

The common shape is an unattended run inside a container. Anthropic's table for fully unattended -p work pairs the flag with a prompt, and requires a container, a VM or the sandbox runtime, run as a non-root user on Linux and macOS.

In that kind of run, the few calls that would still prompt are denied instead, rather than left waiting for an answer. The headless guide covers the rest of a claude -p run.

Source: "Skip all checks with bypassPermissions mode" and the unattended-run table in permission modes, read November 18, 2026.

Safer alternatives

The first alternative costs the least trust. An allow rule names the commands you actually run, so Bash(npm test *) stops those prompts and leaves the rest alone. The same page warns that a rule allows the command, not the target of an output redirect.

The sandbox is the second. It is an operating-system boundary around the commands Claude runs, and it works in either of two modes: approve each command as usual, or let the boundary itself approve them. Turn it on with /sandbox.

Anthropic is careful about the distinction. The sandbox is not a permission mode: modes decide whether a call runs, while the sandbox limits what a command can reach once it runs. The sandbox guide covers what it breaks.

The third is a container. Anthropic's security page recommends running the whole Claude Code process inside the sandbox runtime or a dev container for additional isolation, and using a VM when working with external services.

Sources: "Redirections" in Configure permissions, the sandboxing page and "Security best practices" in security, read November 18, 2026.

Common mistakes

  • Turning it on to avoid a few prompts. An allow rule is narrower and leaves the other prompts in place.
  • Expecting it to work from a project settings file. Project settings do not take effect for this value; the session starts in Manual mode.
  • Running it on a laptop with access to real credentials. The mode skips protected-path checks, and Anthropic says it offers no protection against prompt injection.
  • Running it as root in a container. Linux and macOS refuse to start, unless a recognized sandbox makes the check unnecessary.
  • Planning to switch into it mid-session. It must be enabled when the session starts.

Where these answers come from

  • The flag, its equivalence and the allow variant: the CLI reference, read November 18, 2026.
  • What the mode skips, what no mode approves, the root refusal, the three ways in and the cloud and project limits: permission modes, read the same day.
  • The protected-path warning and the setting that blocks the mode: Configure permissions, read the same day.
  • The sandbox as isolation, and what replaces the prompt in each approach: sandboxing, read the same day.
  • The container and VM advice, and the warning about untrusted content: security, read the same day.

Common questions

Is --dangerously-skip-permissions the same as --permission-mode bypassPermissions?

Yes. Anthropic says the flag is equivalent to passing --permission-mode bypassPermissions, and both put the session in bypassPermissions mode when it starts.

Does bypass mode delete files without asking?

Not always. A recognized rm or rmdir removal of a critical path still asks you to approve it in a terminal and is denied elsewhere, even in this mode; no allow rule or pre-approval hook can approve one. Other dangerous rm commands are flagged rather than auto-approved.

Why does it refuse to start as root?

On Linux and macOS, Claude Code will not start in bypassPermissions mode under root or sudo, for security reasons. The check is skipped automatically inside a recognized sandbox.

Can a project settings file enable it?

No. Anthropic says that setting bypassPermissions in a project settings file does not take effect, and the session starts in Manual mode instead.

Does it work in a cloud session?

No. Cloud sessions ignore defaultMode set to bypassPermissions or dontAsk from your settings files, so a checked-in settings file cannot start one in that mode.