BubbleCodeFounding access

Is --dangerously-skip-permissions safe?

Updated July 27, 2026 · 8 min read

The flag is safe exactly when the environment it runs in is disposable and holds no credentials. On a developer laptop it is not, because the agent inherits every secret your shell can reach — and the reason people reach for it is almost always notification latency, which has better fixes.

The CLI's own guidance

claude --help on 2.1.220 describes --dangerously-skip-permissions as *"Bypass all permission checks. Recommended only for sandboxes with no internet access."* That's the vendor's position, stated in the tool itself. This page is about what it means in practice.

Practically everyone running Claude Code seriously has typed this flag. Usually around the third time an agent stopped mid-refactor to ask whether it could run the test suite it had already run twice. The impulse is completely reasonable. The question is what you're actually agreeing to.

What the flag disables

There are two separate flags, and the difference matters:

FlagEffect
--dangerously-skip-permissionsBypasses all permission checks for this session. Nothing asks.
--allow-dangerously-skip-permissions*Enables the option* to bypass, without turning it on by default. A capability switch, not an action.

The equivalent persistent setting is permissions.defaultMode: "bypassPermissions", and there's a counterpart guard — disableBypassPermissionsMode — that removes the ability to opt in from that settings scope entirely.

What's disabled is the *asking*, not any sandbox. Claude Code does not run tools in a container by default. The agent gets your user account, your filesystem, and your network. Bypassing permissions removes the only thing standing between a plausible-looking command and your machine.

The inheritance problem

This is the part that people underweight. An agent running as you inherits everything you've authenticated:

  • Your SSH keys — including agent-forwarded ones, and push access to every repo you can push to.
  • Your gh / git credentials, so 'clean up the branches' can become a force-push to a shared branch.
  • Cloud CLI sessions: aws, gcloud, kubectl contexts pointing wherever you last pointed them.
  • ~/.npmrc, ~/.pypirc, and other publish tokens.
  • Every .env file on disk, and anything reachable on your VPN or localhost.

None of that requires the model to be malicious. It requires one confidently wrong command — a git checkout . that discards two hours of uncommitted work, a cleanup script whose glob resolves wider than intended, a migration run against the terminal's current DATABASE_URL. These are ordinary mistakes with an unusual blast radius, and the permission prompt exists specifically to catch them.

Prompt injection is the sharper edge

An agent that reads a GitHub issue, a dependency's README, a web page, or a log file is processing untrusted text. With permissions on, an instruction smuggled into that text still has to get past you. With permissions off, there is no second check — the boundary between 'content the agent read' and 'commands the agent runs' is doing all the work.

When bypassing is genuinely fine

This isn't an argument that the flag should never be used. It's an argument about where. Bypassing is reasonable when all of these hold:

  • The environment is disposable — a container, a VM, a fresh CI runner. If the worst case is docker rm, the worst case is fine.
  • It holds no credentials you care about. No SSH keys, no cloud sessions, no publish tokens, no production database URL.
  • The network is constrained, ideally absent. This is the condition the CLI's own help text singles out.
  • The work is reconstructible — everything valuable is committed and pushed somewhere the agent can't reach.

That describes a CI job or a throwaway sandbox well. It describes a laptop with your work SSH key on it not at all.

The safer middle

Most people who want the flag don't want *no oversight*. They want *fewer interruptions*, which is a different thing and has better answers.

1. Allowlist the boring commands

The prompts that drive you to the flag are almost always the same five commands. Approve them once, as a rule, instead of thirty times as a decision:

json
{
  "permissions": {
    "defaultMode": "acceptEdits",
    "allow": [
      "Bash(npm run test *)",
      "Bash(npm run lint *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Bash(git log *)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push *)",
      "Bash(gh pr merge *)",
      "Read(./.env)",
      "Read(~/.aws/**)"
    ]
  }
}

This gets you most of the fluency of bypass mode while keeping the irreversible category behind a human. Note that deny takes precedence over allow, so the floor holds even as the allowlist grows. Full syntax in permission modes explained.

2. Isolate instead of trusting

If you want real autonomy, put the agent somewhere the blast radius is bounded rather than removing the check. A container with a mounted worktree, no SSH agent, and a scoped token gives you *more* freedom than bypass-on-laptop, because you can genuinely stop paying attention.

3. Fix the latency, not the policy

The honest reason the flag is tempting is that being asked is expensive — not the decision, the *noticing*. An agent blocks; you find out eleven minutes later because you were in a different window. Do that four times an afternoon and turning permissions off starts to look like productivity.

But that's a notification problem wearing a permissions costume. If a blocked agent reached you in two seconds wherever you were on screen, the prompt would cost you a click and the flag would lose most of its appeal. That's the whole thesis behind BubbleCode, and it's also achievable in cruder forms with hooks and macOS notifications.

If you're going to do it anyway

  1. 01Commit and push first. Uncommitted work is the most common real loss, and it's entirely preventable.
  2. 02Run in a dedicated worktree (claude --worktree) so the damage is scoped to a branch you can delete.
  3. 03Unset what you don't need for this task — SSH_AUTH_SOCK, cloud profile env vars, DATABASE_URL.
  4. 04Set --max-budget-usd so a runaway loop is bounded in cost as well as scope.
  5. 05Keep deny rules in place. Even in bypass mode, deny rules and PreToolUse hooks are your last line — a guardrail hook can hard-block pushes regardless of mode.
  6. 06Never on a machine with production access. There's no configuration that makes that one okay.

FAQ

What does --dangerously-skip-permissions actually do?

It bypasses all permission checks for the session, so no tool call — including shell commands — stops to ask you. It does not sandbox anything; the agent still runs as your user with your credentials and network access.

Is Claude Code YOLO mode safe on my laptop?

Not really. The agent inherits your SSH keys, cloud CLI sessions, publish tokens, and every .env on disk. The CLI's own help recommends the flag only for sandboxes with no internet access. On a disposable container it's reasonable; on a machine with credentials it removes the only check on a confidently wrong command.

What's the difference between --dangerously-skip-permissions and --allow-dangerously-skip-permissions?

The first turns bypassing on for that session. The second only makes the option available without enabling it — a capability switch rather than an action.

How do I stop permission prompts without turning them all off?

Add specific rules to permissions.allow for the commands you approve reflexively — things like Bash(npm run test *) — while keeping deny rules on irreversible actions. You get most of the fluency without removing the check on the operations that actually matter.

Can I prevent bypass mode from being used at all?

Yes. Set "disableBypassPermissionsMode": "disable" in a settings scope. It removes the ability to opt into no-checks mode from that scope, which is useful for shared project settings.

Keep reading