Claude Dangerously Skip Permissions: When It's Safe to Use
Claude dangerously skip permissions explained: what the flag turns off, when it's reasonable, the real risks, and safer options like auto mode and sandboxing.
Josh Pocock7 min read
AI Coding
Skip permissions
Stride AI Academy
Claude dangerously skip permissions is the claude --dangerously-skip-permissions flag. It starts Claude Code in bypassPermissions mode, where nearly every tool call runs straight away with no approval prompt and no safety check. Anthropic says to use it only in isolated containers or VMs, because nothing stands between Claude and your files, your network or a prompt injection.
This guide covers what the flag turns off, what still applies, when it's reasonable, the real risks and the safer settings most people want instead. Everything here was checked against Claude Code's permission modes docs, the permissions docs, the sandboxing docs and the dev container docs on November 18, 2026.
What the flag does
By default, Claude Code asks before it edits a file, runs most shell commands or fetches a web page. The flag removes those prompts. These two commands are the same:
claude --dangerously-skip-permissions
claude --permission-mode bypassPermissionsIn this mode Claude can write to protected paths too, such as your .claude settings, .mcp.json, shell config files and .git/hooks, which every other mode guards. The first time you start it interactively, Claude Code shows a warning you have to accept. Decline and it exits.
You can't switch into this mode in the middle of a normal session. It has to be enabled at launch, either with the flag or with "defaultMode": "bypassPermissions" in your user settings. A related flag, --allow-dangerously-skip-permissions, adds bypass mode to the Shift+Tab cycle without turning it on.
What still applies in bypass mode
Bypass mode isn't quite "anything goes". According to the docs:
- Deny rules still block. A
denyrule in your settings stops the action in every mode, including this one. - Ask rules still prompt. If you've written an explicit
askrule, you still get asked. - Critical deletions still prompt. Claude Code recognises
rmandrmdiron critical paths and asks, whatever the mode. - Allow rules stop mattering, because everything is already allowed.
- It won't run as root. On Mac and Linux, Claude Code refuses to start in this mode as root or under
sudo, unless it's inside a recognised sandbox.
One thing that surprises people: in an interactive terminal session with bypass available, plan mode no longer blocks edits. Claude is still told to plan, but anything it tries runs without asking.
The real risks
Anthropic's own warning is short: bypass mode "offers no protection against prompt injection or unintended actions."
In practice, that means:
- A wrong guess runs immediately. Claude can delete files, overwrite work or run a migration against the wrong database before you see it happen.
- Prompt injection gets a free pass. A README, web page, issue or dependency with hidden instructions can steer Claude, and there's no prompt to catch the odd command.
- Secrets are in reach. Anything Claude can read, it can send somewhere. The dev container docs warn that, with this flag, a malicious project can take anything inside the container, including the Claude Code credentials in
~/.claude. - Changes reach your real files. In a container with your project mounted, edits still land in the repository on your machine.
On a client's live system, a production database or a laptop full of logins, those risks outweigh the time saved.
When it's reasonable to use
The docs recommend containers, VMs or dev containers without internet access, where Claude Code can't damage your host system. That gives you a simple test. It's reasonable when all of these are true:
- Claude runs inside a container or VM, not on your main machine
- The project is a repository you trust, with no unknown code or content
- No real secrets are mounted: no
~/.ssh, no cloud credential files, no production keys - Network access is limited to what the job needs
- The work is backed by Git, so you can throw away anything you don't like
Anthropic's reference dev container is built for this. It runs Claude Code as a non-root user and includes a firewall script that limits outbound traffic. Even then, the docs say to use it only with trusted repositories and to monitor what Claude does.
Should you skip permissions?
- 1Is Claude inside a container or VM?If not, use auto mode or allow rules instead
- 2Is the repo trusted and backed by Git?
- 3Are secrets and network access locked down?
- 4Then bypass mode is a reasonable choice
Safer options that cut most prompts
Most people reach for this flag because they're tired of approving things. These settings remove most of the prompts and keep the safety checks.
Auto mode
Auto mode has a separate classifier model review each action before it runs. It blocks anything that goes beyond what you asked for, targets infrastructure it doesn't recognise or looks driven by hostile content. Start it with:
claude --permission-mode autoIt's the built-in starting mode for interactive terminal and VS Code sessions on recent versions. Anthropic notes it reduces prompts but doesn't guarantee safety, so keep reviewing sensitive work.
Accept edits mode
acceptEdits lets Claude create and edit files in your project without asking, plus simple file commands such as mkdir, mv and cp. Other shell commands still prompt. Press Shift+Tab once from Manual mode, or start with claude --permission-mode acceptEdits.
Allow and deny lists
Permission rules in .claude/settings.json approve the commands you trust and block the ones you don't. Rules are checked in a fixed order: deny first, then ask, then allow. This example runs npm scripts and commits without asking, refuses pushes and keeps Claude out of your .env file:
{
"permissions": {
"allow": [
"Bash(npm run *)",
"Bash(git commit *)"
],
"deny": [
"Bash(git push *)",
"Read(./.env)"
]
}
}Run /permissions to see every rule and which settings file it came from. The full rule syntax is in our guide to Claude Code permissions. Rules are enforced by Claude Code itself, so they hold even if the model gets confused. A note in CLAUDE.md only shapes what Claude tries to do.
Sandboxing
The built-in sandbox puts an operating system boundary around the shell commands Claude runs. Writes are limited to your project and temp folders, and network traffic only reaches domains you allow. Turn it on with /sandbox. In its auto-allow mode, sandboxed commands run without prompting, which removes most of the friction people use bypass mode to escape.
It works on macOS and on Linux and WSL 2 (which need bubblewrap and socat), but not on native Windows. It also covers shell commands only, not Claude's file tools or MCP servers.
Hooks
A PreToolUse hook can block a specific action, such as any command that touches production, no matter which mode you're in.
Which mode to use
| Mode | What runs without asking | Use it for |
|---|---|---|
plan |
Reading and exploring only | Reviewing an approach first (plan mode) |
default (Manual) |
Reads | Sensitive work and learning |
acceptEdits |
File edits and simple file commands | Iterating on code you're reviewing |
auto |
Most actions, checked by a classifier | Long tasks with fewer prompts |
dontAsk |
Only pre-approved tools; everything else is denied | Locked-down scripts and CI (headless mode) |
bypassPermissions |
Almost everything | Isolated containers and VMs only |
For agencies and teams
If you set Claude Code up for a client or a team, you can switch bypass mode off for everyone. Put this in managed settings:
{
"permissions": {
"disableBypassPermissionsMode": "disable"
}
}Managed settings sit above user and project settings, so nobody can turn the mode back on from their own files. For unattended work, give each job its own container or worktree, use allow lists or dontAsk, and keep production credentials out of reach.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
What does --dangerously-skip-permissions do in Claude Code?
It starts Claude Code in bypassPermissions mode, so tool calls run without approval prompts or safety checks, including writes to protected paths. Deny rules, explicit ask rules and critical deletions still apply. Anthropic recommends it only in isolated containers or VMs.
Is it safe to use --dangerously-skip-permissions?
Only in an isolated environment such as a container or VM with no real secrets, limited network access and a trusted, Git-backed project. On your main machine it offers no protection against prompt injection or mistakes, so use auto mode or allow rules instead.
How do I turn on bypass permissions mode?
Start Claude Code with claude --dangerously-skip-permissions or claude --permission-mode bypassPermissions, or set "defaultMode": "bypassPermissions" in your user settings. You can't switch into it from a session that didn't start with it enabled.
Why does it say it can't be used with root or sudo?
On Mac and Linux, Claude Code refuses to start bypass mode as root or under sudo for security reasons. Run it as a normal user, ideally inside a container where that user can't harm the host.
How do I stop Claude Code asking for permission all the time?
Use auto mode, which has a classifier review actions instead of prompting you, or add allow rules for the commands you trust in .claude/settings.json. Turning on the sandbox with /sandbox also lets sandboxed commands run without prompts.
Can I disable bypass mode for my team?
Yes. Set permissions.disableBypassPermissionsMode to "disable" in managed settings. Managed settings override user and project settings, so nobody can turn it back on locally.