DEV Community

Carlos Oliva Pascual
Carlos Oliva Pascual

Posted on • Originally published at stacknotice.com

Claude Code --dangerously-skip-permissions: What It Does, When It's Safe, When It's Not

You see --dangerously-skip-permissions in the docs, think "that sounds scary but also useful," and wonder whether to use it.

Here's the full breakdown.

Full guide at stacknotice.com/blog/claude-code-skip-permissions-guide-2026

What the permission system does by default

Claude Code asks before every action: write a file, run a command, read a directory. You approve or deny each one. It's your last line of defense against Claude doing something unintended.

--dangerously-skip-permissions removes all of that. Claude runs fully autonomously — no prompts, no pauses.

Three risk tiers

Tier 1 — Low risk:

# Read-only analysis in CI — appropriate
claude --dangerously-skip-permissions --print \
  "analyze TypeScript files and list type safety issues"
Enter fullscreen mode Exit fullscreen mode

No writes, no commands, no state changes. If Claude makes a mistake, the output is just text.

Tier 2 — Medium risk (use with caution):

Running Claude locally with write access. Scope the task tightly:

# Too vague — don't use the flag
claude --dangerously-skip-permissions "improve the codebase"

# Scoped — more acceptable
claude --dangerously-skip-permissions \
  "add JSDoc comments to exported functions in src/utils/"
Enter fullscreen mode Exit fullscreen mode

Tier 3 — Never:

  • Anything touching production
  • Tasks involving credentials or secrets
  • Unscoped tasks on main branch
  • Any environment you don't fully control

The right use case: CI/CD

- name: Run Claude review
  env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  run: |
    claude --dangerously-skip-permissions --print \
      "Review this PR diff for security issues and convention violations.
       $(cat pr.diff)" > review.txt
Enter fullscreen mode Exit fullscreen mode

Safe here because: isolated runner, read-only diff, no writes, runner is destroyed after the job.

Safer alternatives

Allowlist specific commands instead of skipping everything — add to CLAUDE.md:

Allowed bash commands (auto-approve):
- npm test
- npm run lint
- git status
Enter fullscreen mode Exit fullscreen mode

Use --print for analysis tasks that don't need writes at all.

The rule

Anthropic named it "dangerously" deliberately. They could have called it --non-interactive. The word is in the name as a signal.

Use it in isolated, controlled, or read-only environments. Keep the prompts everywhere else.


Full guide with GitHub Actions setup at stacknotice.com/blog/claude-code-skip-permissions-guide-2026

Top comments (0)