Explainer

claude --dangerously-skip-permissions, Explained

claude --dangerously-skip-permissions is a Claude Code flag that makes the agent skip every approval prompt — file edits and shell commands run without asking. It is genuinely useful for unattended runs, and genuinely dangerous on the wrong machine. Here is exactly what it does, when it is reasonable, and the safer options.

By DK, Editor  ·  Last verified: 2026-06-21  ·  How we test  ·  Facts only — no hands-on score

01 / Definition

By default, Claude Code asks for your approval before it does anything with side effects — editing a file, running a bash command, or using certain tools. The --dangerously-skip-permissions flag turns all of those prompts off: the agent executes every action it decides to take, with no confirmation. It is sometimes called "YOLO mode" for exactly that reason.

The flag exists because permission prompts make sense for interactive work but block automation. In a CI job, a disposable container, or any unattended run, there is no human to click "allow," so the agent would stall. Skipping permissions lets it run end to end — at the cost of removing the one checkpoint that catches a destructive or hijacked command before it executes.

02 / What it does

  • What it actually skips

    Every permission prompt: file edits and creation, bash command execution, and tool calls that would normally pause for approval. The agent proceeds straight through, so anything it can do, it does without asking.

  • What it does NOT change

    It does not give the agent new powers. It still runs as your user, with your file access, your network, and your credentials — it simply stops asking first. The blast radius equals whatever your shell could already do.

  • The real risks

    A wrong command (rm, force-push, a bad migration) runs with no checkpoint. Worse, if untrusted content reaches the context — a malicious README, web page, or issue — prompt injection can steer the agent into running attacker-chosen commands or exfiltrating secrets, with nothing to stop it.

  • Safer alternatives

    Prefer a scoped allowlist (pre-approve only the specific tools/commands you trust) over skipping everything. For unattended runs, isolate instead: a throwaway container or VM with no secrets, a restricted network, and only the working directory mounted.

03 / How it works

Claude Code's permission system normally gates side-effecting actions: before an edit or a bash command runs, it prompts you, and you can allow once, allow always, or deny. You can also pre-approve specific tools or commands in your settings so trusted actions stop prompting. --dangerously-skip-permissions overrides that entire layer for the session — no prompts, no per-action gate. The safe pattern is to keep the permission system on and widen the allowlist only as far as you trust, reserving the skip flag for environments where a mistake cannot hurt you.

The one-line rule

Only use --dangerously-skip-permissions where a mistake cannot hurt you: a disposable container or VM with no secrets and a restricted network. Never on your daily-driver machine.

04 / Who it's for

  • Reasonable in: ephemeral CI runners, disposable containers, and sandboxed VMs with no real credentials and limited network access.
  • Never on: your main workstation, any machine holding production credentials or SSH keys, or repos that pull in untrusted content the agent will read.
  • If you are tempted to use it just to stop the prompts during normal work, set a scoped allowlist instead — you keep the safety checkpoint and lose the friction.

05 / Getting started

If you just want fewer prompts during everyday use, configure an allowlist in your Claude Code settings rather than skipping permissions globally — see the install guide and tutorial. If you genuinely need unattended execution, run Claude Code inside a disposable container or VM with the flag, not on your host.

FAQ

Is --dangerously-skip-permissions safe?
Not on a machine you care about. It removes every approval checkpoint, so a mistaken or hijacked command runs with no confirmation. It is reasonable only in an isolated, disposable environment (a container or VM) with no secrets and limited network access.
What does claude --dangerously-skip-permissions actually do?
It tells Claude Code to skip all permission prompts for the session — file edits, bash commands, and tool calls execute without asking. It does not grant new privileges; the agent still runs as your user with your existing access.
When should I use it?
For unattended runs where no human can approve prompts — CI jobs, disposable containers, sandboxed VMs — and only when that environment holds nothing sensitive. For interactive work, use a scoped allowlist instead.
Is there a safer alternative?
Yes. Pre-approve specific trusted tools and commands in your Claude Code settings (an allowlist) so routine actions stop prompting while risky ones still ask. For automation, isolate the run in a container/VM rather than disabling permissions on your host.
Can prompt injection abuse this flag?
Yes — that is the core danger. With permissions skipped, untrusted content the agent reads (a README, web page, or issue) can attempt to steer it into running attacker-chosen commands, and there is no prompt to catch it. Keep permissions on when the agent will read untrusted input.