claude --dangerously-skip-permissions starts Claude Code in bypassPermissions mode, which skips permission prompts, including for writes to protected paths like .git and .claude. Deny rules and explicit ask rules still apply. The official docs say to use it only in isolated containers or VMs; on your own machine, an allowlist, acceptEdits, auto mode or the sandbox are safer ways to get fewer prompts.
claude --dangerously-skip-permissions starts Claude Code in bypassPermissions mode, where it runs shell commands and edits files without asking you first. The flag is equivalent to claude --permission-mode bypassPermissions. Anthropic's documentation says to use this mode only in isolated environments such as containers or VMs, where Claude Code cannot cause damage.
This guide explains exactly what the flag skips, what it does not, the risks on a normal laptop, and the alternatives that cut prompts without removing your review. For the bigger picture, see the complete guide to Claude Code permissions.
What does --dangerously-skip-permissions do?
The --dangerously-skip-permissions flag puts Claude Code in bypassPermissions mode for the session. In that mode Claude Code skips permission prompts for Bash commands, file edits and web requests, including writes to protected paths such as .git, .claude, .vscode and shell profile files like .zshrc.
Allow rules have no effect in this mode, because everything is already allowed. The first interactive launch shows an acceptance dialog; accepting it sets "skipDangerousModePermissionPrompt": true in ~/.claude/settings.json.
claude --dangerously-skip-permissionsA related flag, --allow-dangerously-skip-permissions, adds bypassPermissions to the Shift+Tab mode cycle without starting in it. The docs warn that while bypass is in the cycle of an interactive session, most edits and commands Claude attempts in plan mode can run without a prompt before you approve a plan.
What does bypass mode still block?
Even in bypassPermissions mode, Claude Code keeps a short list of checks. The docs call these "actions no mode auto-approves":
- Deny rules from any settings file
- Tools matched by an explicit
askrule AskUserQuestionand MCP tools marked as requiring user interaction- Recognized removals of critical paths with
rmorrmdir, and commands flagged as a possibly dangerousrm - Reads or writes outside the working directories when
permissions.blockReadsOutsideWorkingDirectoriesorpermissions.blockWritesOutsideWorkingDirectoriesis on - Cross-session messaging safeguards
Claude Code also refuses the mode in some situations. On macOS and Linux it will not start in bypass mode as root or under sudo. It refuses it in --restricted sessions, and administrators can block it with permissions.disableBypassPermissionsMode set to "disable" in managed settings. A project's own .claude/settings.json cannot turn it on: defaultMode: "bypassPermissions" is ignored in project and local settings files.
What are the real risks of skipping permissions?
The main risk of --dangerously-skip-permissions is that nothing stands between a bad instruction and your machine. Claude Code can run any command your user account can run, and you see it only afterwards, if at all.
Concrete ways this goes wrong:
- Prompt injection. A README, an issue, a web page or a dependency can contain text that tells the agent to run something. With prompts on, you see the odd command; with bypass on, it runs. See what prompt injection is.
- Credential exposure. Your shell has access to
~/.ssh, cloud credentials,.envfiles and tokens. The dev container docs warn that in bypass mode a malicious project can exfiltrate anything accessible inside the environment, including the Claude Code credentials stored in~/.claude. - Destructive mistakes. A wrong
git reset --hard, a migration against the wrong database, or a cleanup script with a bad path. Bypass mode keeps somermchecks, but not checks on every destructive tool. - Configuration changes. Writes to protected paths such as
.githooks,.zshrcor.claudesettings are allowed, so a change can outlive the session.
Bash deny rules help, but the docs are explicit that they are not a security boundary: Bash(rm *) does not stop /bin/rm or bash -c 'rm ...'. The auto approve risks article goes deeper on why "it worked fine so far" is not evidence.
How do the Claude Code docs recommend using it?
The Claude Code docs recommend bypass mode only inside an isolated container or VM, with limited network access and no host secrets mounted. The permission modes page describes it as meant for "isolated containers, VMs, or dev containers without internet access".
The dev containers page gives a practical setup. Because the container runs Claude Code as a non-root user and confines commands to the container, you can pass --dangerously-skip-permissions there for unattended work. The same page adds three cautions:
- Claude can still modify any file in the bind-mounted workspace, and those changes appear directly on your host.
- Restrict network egress; Anthropic's reference container includes an
init-firewall.shscript that limits outbound traffic. - Avoid mounting
~/.sshor cloud credential files into the container, and prefer repository-scoped or short-lived tokens. Only use it with trusted repositories.
The general security page says the same thing in shorter form: for additional isolation, run the whole Claude Code process inside a sandbox runtime or a dev container.
What are safer alternatives to --dangerously-skip-permissions?
Most people reach for bypass mode because the prompts are constant. You can remove most of them with options that keep a boundary in place. Ordered from most to least control:
| Option | What it removes | What still asks |
|---|---|---|
Allowlist in permissions.allow | Prompts for the commands you list | Everything else |
acceptEdits mode | Prompts for file edits and basic filesystem commands in scope | Other Bash commands, protected paths |
| Sandbox with auto-allow | Prompts for Bash commands that stay inside the OS sandbox | Commands outside the sandbox, explicit ask rules |
auto mode | Routine prompts; a classifier reviews actions | Actions the classifier blocks, ask rules |
dontAsk mode (CI) | All prompts, by denying anything not pre-approved | Nothing; unapproved calls fail |
The allowlist is covered in how to allow specific commands, and the modes in Claude Code permission modes explained.
The sandbox deserves a closer look. Run /sandbox in a session, or set it in settings, and Claude Code runs shell commands inside an OS-level boundary (Seatbelt on macOS, bubblewrap on Linux and WSL2) with restricted writes and a network allowlist. In auto-allow mode, sandboxed commands run without a prompt.
{
"sandbox": {
"enabled": true,
"network": {
"allowedDomains": ["github.com", "*.npmjs.org"]
}
}
}The sandbox covers shell commands and their child processes, not hooks, MCP servers or file tools, and by default it allows reads across most of the machine, so restrict sensitive paths yourself. Read the sandboxing docs before relying on it.
How do I block --dangerously-skip-permissions for my team?
To prevent bypass mode, set permissions.disableBypassPermissionsMode to "disable". In managed settings it applies to everyone and cannot be overridden; in your own user settings it locks you out of bypass mode too.
{
"permissions": {
"disableBypassPermissionsMode": "disable"
}
}On macOS the managed file lives at /Library/Application Support/ClaudeCode/managed-settings.json. See the settings.json reference for the other locations.
Staying in the loop without the prompt fatigue
The honest reason most developers skip permissions is that prompts arrive in a terminal they are not looking at, and the agent sits idle until they notice. Fixing visibility often removes the need for bypass mode.
Allowbar is a Mac menu bar app built for that case, for Claude Code and Codex. It connects through the agents' own hooks, and when a session asks to run a command or edit a file, a panel slides down from the top of the screen with the project, the tool and the exact command. You click Allow, Block or Terminal. It is the opposite of bypass mode: Allowbar never approves anything on its own, has no auto approval rules, and if you do not answer before the countdown ends or the app is closed, the question goes back to the terminal. A missing answer is never treated as approval.
We compare the two approaches in detail in Allowbar vs skipping permissions. Allowbar is Mac only (macOS 14 or later) and is in private beta. Join the waitlist; the launch price is $9.99 instead of $29.90.
Sources:
- Permission modes, Claude Code docs
- Configure permissions, Claude Code docs
- Development containers, Claude Code docs
- Sandboxing, Claude Code docs
- Security, Claude Code docs
- CLI reference, Claude Code docs
Frequently asked questions
Is --dangerously-skip-permissions the same as bypassPermissions?
Yes. The CLI reference says --dangerously-skip-permissions is equivalent to --permission-mode bypassPermissions. You can also set "defaultMode": "bypassPermissions" in user or managed settings, but not in project settings.
Do deny rules work with --dangerously-skip-permissions?
Yes. Deny rules apply in every permission mode, including bypass mode, and explicit ask rules still prompt. Bash deny rules match the command as written, though, so they are not a full security boundary.
Why does Claude Code refuse --dangerously-skip-permissions with sudo?
On macOS and Linux, Claude Code refuses bypass mode when it runs as root or under sudo, for security reasons. In a container, set a non-root user, as Anthropic's dev container guidance recommends.
Is it safe to use --dangerously-skip-permissions in a Docker container?
It is the setting the docs recommend, but not risk free. A container still exposes the bind-mounted workspace, whatever network it can reach, and any credentials inside it. Restrict egress, do not mount host secrets, and only use trusted repositories.
What should I use instead on my laptop?
Start with an allowlist for your routine commands, then consider acceptEdits, the sandbox in auto-allow mode, or auto mode. Each removes most prompts while keeping a boundary that bypass mode removes.