claude --dangerously-skip-permissions starts Claude Code in bypassPermissions mode, the same as --permission-mode bypassPermissions, so tool calls run without permission prompts, including writes to protected paths such as .git and .claude. Deny rules, ask rules and recognized critical rm removals still apply. Anthropic says to use it only in containers or VMs; auto mode, allow/deny rules and the Bash sandbox cut prompts more safely.

claude --dangerously-skip-permissions

Applies to: Claude Code 2.1.336 (npm latest; stable is 2.1.332), per the npm registry. Last checked: December 4, 2026 against the permission modes, permissions, CLI reference and dev container docs.

On this page

What the flag does

The CLI reference describes --dangerously-skip-permissions as “Skip permission prompts. Equivalent to --permission-mode bypassPermissions.” These two commands start the same mode:

claude --dangerously-skip-permissions
claude --permission-mode bypassPermissions

According to the permission modes page, bypassPermissions “disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths.” Allow rules have no effect in this mode, because everything is already approved; deny rules block in every mode.

Warning

Anthropic: “Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system.” The docs add that bypassPermissions “offers no protection against prompt injection or unintended actions.” (Permission modes)

What still prompts in bypass mode

The permission modes page lists “actions no mode auto-approves”. They still end in a prompt or a denial in bypassPermissions (Permission modes):

  • Tools matched by an explicit ask rule. Deny rules block in every mode.
  • Connector tools your organization set to ask, where that setting reaches Claude Code.
  • Tools that require user interaction: the built-in AskUserQuestion tool and MCP tools marked requiresUserInteraction.
  • Recognized rm and rmdir removals of critical paths such as the filesystem root or your home directory, which no allow rule or PreToolUse hook "allow" approves.
  • The cross-session messaging safeguards.
  • With permissions.blockReadsOutsideWorkingDirectories on (Claude Code v2.1.257 or later), reads outside the working directories and any unsandboxed retry that needs approval.

In a -p run, the few calls that would still prompt are denied instead (Permission modes).

The first-run warning dialog

The first time you start an interactive session with this mode enabled, Claude Code shows a warning dialog asking you to accept responsibility for actions taken without permission checks (Permission modes):

  • If you accept, Claude Code sets skipDangerousModePermissionPrompt to true in ~/.claude/settings.json, so later sessions skip the dialog. Remove the key or set it to false to see the dialog again.
  • If you decline, Claude Code exits.
  • In non-interactive mode (-p) no dialog is shown.
  • A background session started with claude --bg --permission-mode bypassPermissions is refused until you have accepted the dialog in an interactive session.

Root and sudo are refused

On Linux and macOS, Claude Code refuses to start in this mode as root or under sudo and prints (Permission modes):

--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, the docs point to the dev container configuration, which runs Claude Code as a non-root user.

Other refusals: restricted mode and cloud sessions

  • --restricted: Claude Code refuses bypassPermissions in a session started with --restricted (v2.1.248 or later) and prints Error: bypassPermissions not supported in restricted mode. Remove the flag or setting that enables bypass (Permission modes).
  • Settings files: defaultMode: "bypassPermissions" in .claude/settings.json or .claude/settings.local.json does not take effect, and the session starts in Manual mode. The mode applies from user, --settings or managed settings.
  • Claude Code on the web: cloud sessions do not honor defaultMode: "bypassPermissions", “so a repository’s checked-in settings can’t start a cloud session in bypass-permissions mode.” Bypass permissions isn’t available there.

The --allow-dangerously-skip-permissions variant

--allow-dangerously-skip-permissions adds bypassPermissions to the Shift+Tab mode cycle without starting in it (CLI reference). You can begin in plan mode and switch later:

claude --permission-mode plan --allow-dangerously-skip-permissions

You cannot enter bypassPermissions from a session you started without it enabled.

Warning

the CLI reference notes that while bypassPermissions is in the cycle of an interactive terminal session, most edits and commands Claude attempts in plan mode can run with no prompt, before you approve a plan. The permission modes page says not to rely on plan mode’s blocks there; they hold in -p runs, Agent SDK sessions and the VS Code chat panel.

Bypass in VS Code, Desktop and the web

  • VS Code: Bypass permissions requires the Allow dangerously skip permissions toggle in the extension settings. Without it the mode does not appear in the indicator (Permission modes).
  • Desktop: requires the Allow bypass permissions mode toggle in Desktop settings on Pro, Max and Ultra plans; on Team and Enterprise plans, organization policy controls it.
  • Claude Code on the web: Bypass permissions is not available in cloud sessions.

The extra variable for critical-path removals

CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1 turns off the prompt for critical-path rm and rmdir removals in bypassPermissions mode. It requires Claude Code v2.1.311 or later and is read only from the launch environment, not from a settings file’s env block (Permission modes):

export CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1
claude --permission-mode bypassPermissions

Warning

Anthropic: with this variable set, “you lose a safety prompt for destructive deletes: a command such as rm -rf ~ can run without asking you. Set it only in an isolated environment whose contents you can afford to lose.”

All permission modes compared

Claude Code has six modes. The table follows the permission modes page.

Mode What runs without asking Anthropic’s suggested use
default Reads only Getting started, sensitive work
acceptEdits Reads, file edits, and common filesystem commands (mkdir, touch, rm, rmdir, mv, cp, sed) inside the working directory Iterating on code you’re reviewing
plan Reads only; Claude explores and writes a plan but does not edit your source Exploring a codebase before changing it
auto Everything, with background safety checks by a classifier Long tasks, reducing prompt fatigue
dontAsk Only pre-approved tools; everything else is denied Locked-down CI and scripts
bypassPermissions Everything except the actions no mode auto-approves Isolated containers and VMs only

default is labeled Manual in the CLI and the IDE extensions, and manual is accepted as an alias from v2.1.200 (CLI reference). With v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions, so on current versions you only reach bypass by asking for it.

Switching modes

In the CLI, Shift+Tab cycles default → acceptEdits → plan. Optional modes slot in after plan. To start in a mode, pass the flag:

claude --permission-mode plan

To make a mode the default, set defaultMode in settings:

{
  "permissions": {
    "defaultMode": "acceptEdits"
  }
}

The same --permission-mode flag works with -p for non-interactive runs (Permission modes). Detailed rule syntax is in our Claude Code permissions guide.

Auto mode: Anthropic’s suggested alternative to bypass

The docs’ answer to “fewer prompts without skipping checks” is auto mode: “For background safety checks with far fewer permission prompts, use auto mode instead” (Permission modes).

  • Requires Claude Code v2.1.83 or later.
  • A separate classifier model reviews actions before they run and blocks anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read.
  • Blocked by default: curl | bash-style download-and-execute, sending sensitive data to external endpoints, production deploys and migrations, mass deletion on cloud storage, granting IAM or repo permissions, force push or pushing directly to main, among others.
  • On Team and Enterprise, an admin must enable it first. On the Anthropic API it needs Claude Opus 4.6 or later, or Sonnet 4.6; on Bedrock, Vertex AI and Foundry only Opus 4.7 and Opus 4.8, with CLAUDE_CODE_ENABLE_AUTO_MODE set.
  • If the classifier blocks an action 3 times in a row or 20 times in total, auto mode pauses and Claude Code goes back to prompting.

Warning

Anthropic calls auto mode “a research preview. It reduces prompts but does not guarantee safety. Use it for tasks where you trust the general direction, not as a replacement for review on sensitive operations.” (Permission modes)

Start in it with:

claude --permission-mode auto

Claude Code v2.1.142 and later ignore defaultMode: "auto" in .claude/settings.json and .claude/settings.local.json, “so a repository cannot grant itself auto mode.” Put it in ~/.claude/settings.json instead.

Allow and deny rules instead of skipping everything

Permission rules pre-approve or block specific tools and keep the rest of the prompts. Rules are evaluated deny first, then ask, then allow; the first match wins (Permissions). This example from the docs allows npm scripts and commits but blocks git push:

{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git commit *)",
      "Bash(git * main)",
      "Bash(* --version)",
      "Bash(* --help *)"
    ],
    "deny": [
      "Bash(git push *)"
    ]
  }
}

Useful details from the same page:

  • /permissions lists every rule and the settings.json file it comes from.
  • A bare tool name such as Bash in deny removes the tool from Claude’s context entirely; a scoped rule like Bash(rm *) blocks only matching calls.
  • Claude Code understands &&, ||, ; and |, so Bash(safe-cmd *) does not approve safe-cmd && other-cmd.
  • Rules are enforced by Claude Code, not by the model. Instructions in CLAUDE.md shape what Claude tries but do not change what is allowed.
  • From the command line, --allowedTools and --disallowedTools take the same rule syntax (CLI reference).

For CI that should never prompt and never exceed a fixed list, the docs point to dontAsk: it “auto-denies every tool call that would otherwise prompt,” so only permissions.allow rules and read-only Bash commands run. The permission modes page gives this CI example:

claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"

Rules can also live in hooks: a PreToolUse hook can deny a call, force a prompt or skip it, but it cannot override a matching deny or ask rule. Our Claude Code hooks guide covers events, matchers and exit codes.

Sandboxing: OS-level limits for Bash

The built-in Bash sandbox lets commands run without prompts inside a boundary the operating system enforces (Sandboxing). It runs on macOS (Seatbelt), Linux and WSL2; native Windows is not supported. Start it from a session:

/sandbox

On Linux and WSL2 it needs bubblewrap and socat:

sudo apt-get install bubblewrap socat

By default, sandboxed commands can write only to the working directory and the session temp directory, and a new network domain prompts the first time it is used. In auto-allow mode, sandboxed commands run without asking, while explicit deny rules, content-scoped ask rules such as Bash(git push *) and rm on critical paths still go through the normal flow. To extend write access to a specific path:

{
  "sandbox": {
    "enabled": true,
    "filesystem": {
      "allowWrite": ["~/.kube", "/tmp/build"]
    }
  }
}

When a command fails because of the sandbox, Claude may retry it outside the sandbox with the dangerouslyDisableSandbox parameter. By default an allow rule or bypassPermissions mode can approve that retry with no prompt; strict sandbox mode turns the retry off (Permission modes). Setting "allowUnsandboxedCommands": false removes this escape hatch. sandbox.failIfUnavailable: true turns a missing sandbox into a hard failure instead of a warning. More in our Claude Code sandbox guide.

The permissions page frames the two as layers: permission rules control which tools and paths Claude can use; the sandbox restricts what Bash commands and their child processes can reach “even if a prompt injection bypasses Claude’s decision-making.”

Dev containers: where bypass mode belongs

If you do need unattended runs, the documented place is a dev container. Add Claude Code with the Dev Container Feature in .devcontainer/devcontainer.json (Development containers):

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
  }
}

The docs say that because the container runs Claude Code as a non-root user and confines command execution, “you can pass --dangerously-skip-permissions for unattended operation.” Confirm remoteUser is a non-root account, since the CLI rejects the flag as root. For a one-shot unattended run, the permission modes page lists claude -p "<prompt>" --dangerously-skip-permissions and requires a container, VM or the sandbox runtime.

Warning

“When executed with --dangerously-skip-permissions, dev containers do not prevent a malicious project from exfiltrating anything accessible inside the container, including the Claude Code credentials stored in ~/.claude.” Anthropic advises using dev containers only with trusted repositories, not mounting host secrets such as ~/.ssh, and pairing the flag with network egress restrictions. (Development containers)

The edits Claude makes in the bind-mounted workspace appear directly on your host. The anthropics/claude-code repository includes a reference container with an init-firewall.sh script that blocks outbound traffic except the domains Claude Code and your tools need.

How admins disable bypass mode

Set permissions.disableBypassPermissionsMode to "disable" in managed settings (Permissions):

{
  "permissions": {
    "disableBypassPermissionsMode": "disable"
  }
}

permissions.disableAutoMode works the same way for auto mode. Either key can sit in any settings file, and a user can set it in their own settings to lock themselves out of bypass mode, but the docs note they are “most useful in managed settings where they can’t be overridden.” On Linux, Claude Code reads /etc/claude-code/managed-settings.json at the highest precedence (Development containers). Because a Dockerfile in the repository can be edited by anyone with write access, the docs recommend server-managed settings or MDM for policy engineers cannot bypass.