--dangerously-skip-permissions: what it skips, what stays
Updated
--dangerously-skip-permissions starts Claude Code in bypassPermissions mode. Ordinary edits, commands and web fetches run without approval, including writes to normally protected project files. Explicit ask and deny rules still apply. Claude Code also retains safeguards for certain critical operations and cross-session messages. Anthropic’s permission modes
The Codex equivalent is --dangerously-bypass-approvals-and-sandbox, alias --yolo, and it goes further: it also removes Codex’s sandbox.
claude --dangerously-skip-permissions
The first time you start it this way, Claude Code shows a warning you must accept. Accepting saves "skipDangerousModePermissionPrompt": true in ~/.claude/settings.json, so you won’t see it again. In a script with claude -p, there’s no dialog.
What it turns off, and what still applies#
Turned off:
- Ordinary approval prompts for commands, edits and web fetches
- Your allow rules, which no longer matter, since everything not denied runs
- The protection of
.git,.claude,.vscode,.bashrc,.mcp.jsonand similar paths, which become writable
Still applies:
- Deny rules. A
"deny": ["Bash(git push *)"]blocks in every mode, including this one. - Explicit ask rules. A rule in
"ask"still prompts. - Deleting critical paths. By default, recognized critical removals still require confirmation. Some PowerShell removals are denied.
- The shell sandbox, if enabled. It restricts supported shell commands. File tools, MCP servers and hooks run outside that boundary. Check the effective sandbox policy and whether it permits unsandboxed commands. Anthropic’s sandbox scope
- Admin settings. Managed deny rules can’t be overridden.
An explicit deny rule protects the matching tool call. For example, blocking a secret through the Read tool does not isolate the same file from a shell running as your user. Use filesystem isolation for a boundary that applies to that shell too. Claude Code sandboxing
Guards around the flag#
The flag configures a terminal session. In the Code tab of Claude Desktop, check the mode selector below the prompt. Local sessions can remember a selection per folder, and managed organizations can restrict the available modes. The VS Code extension has its own mode indicator. Cowork has separate controls. Anthropic’s guide to mode selection by interface
- No root. On Linux and macOS, Claude Code refuses to run with it as root or under sudo:
--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons. The check is skipped inside a recognized sandbox. Windows has no such check. - Not from a project. Setting
"defaultMode": "bypassPermissions"in a project’s.claude/settings.jsonis ignored. It only works in your own user settings or managed settings, so a repository you clone can’t switch it on for you. - Admins can block it, and so can you:
"permissions": {"disableBypassPermissionsMode": "disable"}. - Opt in without starting in it.
claude --allow-dangerously-skip-permissionsadds bypass mode to the Shift+Tab cycle without turning it on. Without one of the two flags at startup, you can’t switch into bypass during a session.
The equivalents in other tools#
| Tool | Flag | Also removes the sandbox? |
|---|---|---|
| Claude Code | --dangerously-skip-permissions |
No: the sandbox stays if enabled |
| Codex | --dangerously-bypass-approvals-and-sandbox, alias --yolo |
Yes: sets approval_policy = never and sandbox_mode = danger-full-access |
| Copilot CLI | --allow-all, alias --yolo |
Check the active session with /sandbox status. The interactive Autopilot prompt can offer to disable the sandbox as well, subject to organization policy. |
| Cursor CLI | --force, alias --yolo |
Separate: --sandbox enabled |
| OpenCode | --auto |
OpenCode has no sandbox |
For fewer prompts, codex --approve-for-me keeps the workspace sandbox and routes eligible requests to automatic review. With codex -a never --sandbox workspace-write, actions that require escalation cannot ask for it. The effective sandbox settings determine writable roots and network access. Additional roots and explicitly enabled networking still apply. OpenAI’s approval and sandbox guide
When it’s the right flag#
For unattended runs in a box where nothing can go wrong: a container or VM with only the project mounted, no credentials, ideally no network. That’s what Anthropic’s docs recommend. A typical use is a long refactoring or a batch job running overnight in a dev container, on a fresh clone you can throw away.
The same split holds from the other side. Approval prompts decay into muscle memory (“Click. Approve. Click. Approve. Production incident.”), so where nobody sits at the keyboard there should be no fallback prompt at all, only deny by default: a newly connected MCP server or API stays refused until a rule names it. Skipping prompts is safe when the rules underneath were written for a run with nobody watching, not when they were written for a person who would have caught the rest.
It’s the wrong flag on your laptop, with your SSH keys in ~/.ssh, your cloud logins in your home folder, and push access to your company’s repositories. The model doesn’t have to be malicious to do damage there. It only has to read a web page or an issue with instructions planted in it.
The reasoning behind the Contenox Runtime sandbox puts the difference in one line: the same model can be safe in one mode and dangerous in the other. An agent in bypass mode doesn’t request effects through a gate somebody owns; it simply has them, by any path its process can take. “The model is aligned” is not a control.
Safer ways to get the same speed#
-
Write deny rules first. If you use the flag, it’s only as safe as your deny list. A minimal one:
{ "permissions": { "deny": [ "Read(./.env)", "Read(./.env.*)", "Read(~/.ssh/**)", "Read(~/.aws/**)", "Bash(git push *)", "Bash(sudo *)" ] } } -
Turn on the shell sandbox. On macOS, Linux and WSL2, Claude Code can run supported commands with filesystem and network restrictions. Its default writable locations include the working directory, a temporary directory and additional directories you granted. Native Windows shell commands run unsandboxed. Sandbox scope and defaults
-
Use auto mode. Eligible interactive terminal and VS Code sessions default to auto from v2.1.283. Local settings, the model and organization policy can change availability. Non-interactive
claude -pand Agent SDK runs default to Manual when no permission mode is set. Claude Code’s default modes -
Use
acceptEdits(claude --permission-mode acceptEdits) if the prompts you hate are mostly edits. Edits and simple file commands inside the project run; other commands still ask. -
Allow your routine commands by rule.
npm test *,npm run build,git add *. See why your agent keeps asking.
Skipping the prompt doesn’t have to mean skipping the rules. An earlier build of the agent engine ran overnight report jobs with prompts off: the job’s rules allowed exactly one thing, writing files under reports/**, and anything else it tried (a write elsewhere, a shell command, a network call) matched no rule and parked as a question in an approval queue instead of running. The rule as that build phrased it: instruction is not enforcement, and the unattended flag removes the prompt, never the boundary.
Contenox Harness#
Contenox Harness aims at YOLO speed on the routine work without the YOLO horror story: the routine commands run without a card, and the dangerous part still asks. What runs without asking is a rule set that can be read and changed under Permissions; the destructive commands and credential stores stay gated or blocked. The command line has --auto for throwaway CI runners, the one place where skipping prompts is the right call. See built-in tools and permissions.
Related guides#
YOLO mode in Claude Code, Codex, Copilot and Cursor: every tool’s skip-all switch side by sideYOLO mode in Claude Code, Codex, Copilot and CursorYOLO mode turns off a coding agent's approval prompts. The exact flag in Claude Code, Codex, Copilot, Cursor and OpenCode, what each one turns off, and what's left.
Why does my agent keep asking for permission?: the causes and the fixesWhy does Claude Code or Codex keep asking for permission?Claude Code, Codex, Copilot or Cursor keeps asking for permission? The real cause in each tool, the exact rule or setting that fixes it, and what to keep asking.
How to sandbox AI coding agents: the box the flag needsHow to sandbox an AI coding agent: Claude Code, Codex, OpenCodeHow to sandbox an AI coding agent so a mistake, a prompt injection or a poisoned package can't reach your keys: built-in sandboxes, containers, and the traps.
How to keep secrets away from AI agents: the deny list in detailHow to keep secrets away from AI agents (and out of git)How to keep secrets away from AI agents: block .env reads in Claude Code, OpenCode and Codex, stop keys leaking through commands, and what to do if one leaked.
Agent permissionsAI agent permissions: what to allow, ask and blockAI agent permissions for coding agents: a safe starting rule set, real config for Claude Code and Codex, the gaps in command rules, and when to skip prompts.