Guide · Coding agents · Read in the Claude Code docs on 19 November 2026
Claude Code --dangerously-skip-permissions, without losing a server.
Short answer. --dangerously-skip-permissions starts Claude Code in bypassPermissions mode: it edits files, runs shell commands and reaches the network without asking you first. Deny rules still block, and a short list of actions still prompts, but allow rules stop mattering. Anthropic's documentation says to use it only in an isolated container or VM. If what you want is fewer prompts on your own machine, acceptEdits, the sandbox in auto-allow mode or auto mode remove most of them and keep a check in place.
What does --dangerously-skip-permissions do?
The flag is a shortcut for --permission-mode bypassPermissions. In that mode Claude Code skips its permission prompts, including the ones for writes to protected paths such as .git and .claude. It is one of six permission modes, and the only one the documentation reserves for "isolated containers and VMs only".
terminalthree ways to reach the modeclaude --dangerously-skip-permissions claude --permission-mode bypassPermissions claude --permission-mode plan --allow-dangerously-skip-permissions # adds it to Shift+Tab, starts in plan
Two details catch people out. Allow rules have no effect in this mode, because nothing is waiting for approval. And a project's .claude/settings.json cannot switch a session into it: a defaultMode of bypassPermissions there is ignored, so a cloned repository cannot turn your prompts off for you.
What does bypassPermissions still block?
The mode removes prompts, not every control. According to the permission modes page, these still apply:
| Still active | What happens |
|---|---|
| Deny rules | A rule in permissions.deny blocks the call in every mode, bypassPermissions included. Allow rules, by contrast, have no effect in this mode. |
| Explicit ask rules | A tool matched by an ask rule still prompts. Use one for the few commands you want to see every time. |
| Critical-path removals | Recognized rm and rmdir commands on a critical path still go through the permission flow; no allow rule or hook approves them. |
| Tools that need a person | AskUserQuestion and MCP tools marked as requiring user interaction. |
| Organization connector rules | Connector tools your organization set to ask still prompt, when that setting reaches your session. |
| Reads and writes outside the project | Only when you turn on blockReadsOutsideWorkingDirectories or blockWritesOutsideWorkingDirectories. Off by default. |
A PreToolUse hook also keeps running and can deny a call; the hook receives the current mode in its input. So deny rules and hooks are the two levers you keep. Everything you did not deny runs.
What can go wrong without prompts?
The damage often comes from an ordinary request, with no attacker involved. We lived through one: a coding agent driving a server from PowerShell was asked to move a folder and sent ssh root@vps "mv $SRC/* $DST/". PowerShell expanded both variables locally, they were empty, and the server received a mv from the root. It did not come back.
Each command below answers a reasonable request and destroys something on the way. A permission prompt is the moment a person reads the target; without it, the command runs.
| What was asked | What the agent runs | What happens |
|---|---|---|
| Move the old release on the server | ssh vps "mv $SRC/* $DST/" | Run from PowerShell, the variables expand empty on the local side: the mv starts from the root. |
| Delete the build folder | rm -rf /$DIR | $DIR is empty, so the command becomes rm -rf /. |
| Deploy the build | rsync -a --delete ./build/ vps:/ | --delete to the root: everything not in the build is wiped. |
| Get the repo clean | git reset --hard && git clean -fdx | Uncommitted work and ignored files, your .env included, are gone. |
| Free up some disk space | docker system prune -af --volumes | Volumes go with the images, and the containers' databases with them. |
| Tear down the test environment | terraform destroy -auto-approve | In the wrong workspace, production goes, with no confirmation. |
The full list of 15 commands, with what a guard should do for each, is in the free agent shell guard kit. When we replayed 12 of them against detection rules that look for patterns such as rm -rf, only one fired: the risk sits in the target and in variables that can be empty, more than in the command name.
The other risk is content. With prompts off, an instruction hidden in a README, an issue or a web page the agent reads goes straight to execution. Our prompt injection examples show what a current model did with 13 of them.
What are the safer alternatives?
Most people who reach for the flag want one specific prompt gone. Pick the narrowest option that removes it.
| You want | Use | What runs without asking |
|---|---|---|
| Fewer prompts while you watch | --permission-mode acceptEdits | File edits and common filesystem commands in the project run without asking; other commands still prompt. |
| Long tasks with a safety check | --permission-mode auto | No routine prompts; a background classifier checks shell commands and network requests against your request before they run. |
| Shell commands without prompts, inside a boundary | /sandbox, then auto-allow | Sandboxed commands run without asking; writes stay in the project and temp folders, network goes through an allowlist. macOS, Linux and WSL2. |
| Specific commands pre-approved | --allowedTools "Bash(npm test *)" | Only the commands you list skip the prompt; everything else asks. |
| Unattended CI that never waits | --permission-mode dontAsk | Anything that would prompt is denied instead; pre-approved tools and project reads still run. |
| No prompts at all | --dangerously-skip-permissions | Same as --permission-mode bypassPermissions. For isolated containers and VMs only. |
The sandbox row is the one most teams overlook. It removes prompts for shell commands and adds an operating-system boundary at the same time: commands can write to the project and temp folders only, and outbound connections go through a proxy that checks each host against an allowlist that starts empty. It runs on macOS, Linux and WSL2; on native Windows, commands run unsandboxed. Our Claude Code security guide covers strict sandbox settings for a team.
How do you run --dangerously-skip-permissions safely?
If you need fully unattended runs, put the flag inside a boundary that limits what a bad command can reach. In order:
- Run it in a container or VM, as a non-root user. The CLI refuses the flag when launched as root. Anthropic's reference dev container runs Claude Code as a non-root user and ships an
init-firewall.shscript that limits outbound traffic to the destinations it allows. - Mount nothing you cannot lose. No SSH keys, no cloud credentials, no production kubeconfig, no
.envwith live secrets. The dev container page warns that the container does not stop a malicious project from sending out anything inside it, Claude Code's own credentials in~/.claudeincluded. - Only trusted repositories. A repository you have not read can carry instructions for the agent in its files.
- Keep deny rules for the irreversible, and know their limit. They still block in this mode, and they apply to each part of a compound command. They match the text Claude writes, though:
Bash(git push *)stopsgit push origin main, notgit -C . push origin main. The documentation says it plainly: a Bash rule is not a security boundary. The container and the sandbox are. - Close the sandbox escape hatch. When a command fails inside the sandbox, Claude can retry it unsandboxed, and in
bypassPermissionsthat retry runs without a prompt. SetallowUnsandboxedCommandstofalse.
.claude/settings.jsona starting point inside the container{
"permissions": {
"deny": [
"Bash(git push *)",
"Bash(terraform destroy *)",
"Bash(kubectl delete *)",
"Read(./.env)",
"Read(./secrets/**)"
],
"blockReadsOutsideWorkingDirectories": true
},
"sandbox": {
"enabled": true,
"allowUnsandboxedCommands": false,
"failIfUnavailable": true
}
}failIfUnavailable makes Claude Code exit at startup when the sandbox cannot start, instead of silently running commands without it. Add a PreToolUse hook for checks a pattern cannot express, such as refusing any command whose target resolves to /.
How do you turn it off for a team?
Set permissions.disableBypassPermissionsMode to "disable" in managed settings. Managed settings cannot be overridden by users, so the flag, the mode and its place in the Shift+Tab cycle stop working on every managed machine. permissions.disableAutoMode does the same for auto mode. A developer can also set the key in their own settings to lock themselves out of the mode.
In the desktop app, the mode only appears once "Allow bypass permissions mode" is on in its settings, and on Team and Enterprise plans organization policy controls that toggle.
