--dangerously-skip-permissions starts Claude Code in bypassPermissions mode: it edits files, runs commands and fetches URLs without asking you first. It’s the same as claude --permission-mode bypassPermissions. Your deny rules still apply; everything else that would have asked just runs.
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:
- Every approval prompt 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.
rmon a drive root or a system folder still asks. - The sandbox, if enabled. Commands stay inside it, though hosts outside the network allowlist are allowed without a prompt.
- Admin settings. Managed deny rules can’t be overridden.
So the flag is less absolute than its name suggests, if you’ve written deny rules first. With an empty settings file, nothing stands between the model and your machine.
Guards around the flag
- 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 | Copilot’s sandbox is separate and off by default |
| Cursor CLI | --force, alias --yolo | Separate: --sandbox enabled |
| OpenCode | --auto | OpenCode has no sandbox |
If you searched for the Codex version of this flag because you want Codex to stop asking: you probably don’t want --yolo. codex --approve-for-me keeps the workspace-write sandbox and lets an automatic reviewer handle approvals. And codex -a never --sandbox workspace-write never asks, while the sandbox still keeps it inside the project and off the network.
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.
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.
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 sandbox instead. With
{"sandbox": {"enabled": true}}, sandboxed commands run without prompts, writes stay in the project, and network goes through an allowlist. Available on macOS, Linux and WSL2; on native Windows, commands run unsandboxed. -
Use auto mode. It’s Claude Code’s default since v2.1.283: a classifier approves routine actions, and you only see the unusual ones.
-
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.
Contenox
Contenox’s default rules are built so you don’t need a flag like this. Builds, tests, linters and read-only git commands run without asking; rm, sudo and history changes keep asking; keys and credentials are blocked. For your own machine, a looser set allows everything not named and still asks before the risky commands. The command line has --auto for CI runners you throw away, 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 side
- Why does my agent keep asking for permission?: the causes and the fixes
- How to sandbox AI coding agents: the box the flag needs
- How to keep secrets away from AI agents: the deny list in detail