claude-code - 💡(How to fix) Fix Docs: --dangerously-skip-permissions still shows confirmation dialog; --permission-mode dontAsk is the headless flag, but nothing says so [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52506Fetched 2026-04-24 06:05:22
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

claude --help lists three permission-related flags that overlap in confusing ways:

--allow-dangerously-skip-permissions   Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.
--dangerously-skip-permissions         Bypass all permission checks. Recommended only for sandboxes with no internet access.
--permission-mode <mode>               choices: acceptEdits, bypassPermissions, default, dontAsk, plan, auto

For autonomous / headless / scripted sessions, the user needs the session to avoid human-interactive prompts. The discoverable-named flag --dangerously-skip-permissions sounds like it does exactly that. But in practice:

  • --dangerously-skip-permissions → session still shows the one-time "Bypass Permissions mode … 1. No, exit / 2. Yes, I accept" dialog, and parks there waiting for keypress.
  • --permission-mode bypassPermissions → same dialog, same park.
  • --permission-mode dontAskworks. No dialog. Session proceeds to process the first prompt immediately.

The name dontAsk is the opposite end of the spectrum from the dramatic-sounding flags, so users reach for --dangerously-skip-permissions first, hit the dialog, and have no clear signal that they should try dontAsk instead.

Root Cause

claude --help lists three permission-related flags that overlap in confusing ways:

--allow-dangerously-skip-permissions   Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.
--dangerously-skip-permissions         Bypass all permission checks. Recommended only for sandboxes with no internet access.
--permission-mode <mode>               choices: acceptEdits, bypassPermissions, default, dontAsk, plan, auto

For autonomous / headless / scripted sessions, the user needs the session to avoid human-interactive prompts. The discoverable-named flag --dangerously-skip-permissions sounds like it does exactly that. But in practice:

  • --dangerously-skip-permissions → session still shows the one-time "Bypass Permissions mode … 1. No, exit / 2. Yes, I accept" dialog, and parks there waiting for keypress.
  • --permission-mode bypassPermissions → same dialog, same park.
  • --permission-mode dontAskworks. No dialog. Session proceeds to process the first prompt immediately.

The name dontAsk is the opposite end of the spectrum from the dramatic-sounding flags, so users reach for --dangerously-skip-permissions first, hit the dialog, and have no clear signal that they should try dontAsk instead.

Code Example

--allow-dangerously-skip-permissions   Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.
--dangerously-skip-permissions         Bypass all permission checks. Recommended only for sandboxes with no internet access.
--permission-mode <mode>               choices: acceptEdits, bypassPermissions, default, dontAsk, plan, auto

---

--dangerously-skip-permissions   Enable bypass mode; first run in a new session still requires interactive confirmation. For non-interactive sessions use --permission-mode dontAsk.
RAW_BUFFERClick to expand / collapse

Summary

claude --help lists three permission-related flags that overlap in confusing ways:

--allow-dangerously-skip-permissions   Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.
--dangerously-skip-permissions         Bypass all permission checks. Recommended only for sandboxes with no internet access.
--permission-mode <mode>               choices: acceptEdits, bypassPermissions, default, dontAsk, plan, auto

For autonomous / headless / scripted sessions, the user needs the session to avoid human-interactive prompts. The discoverable-named flag --dangerously-skip-permissions sounds like it does exactly that. But in practice:

  • --dangerously-skip-permissions → session still shows the one-time "Bypass Permissions mode … 1. No, exit / 2. Yes, I accept" dialog, and parks there waiting for keypress.
  • --permission-mode bypassPermissions → same dialog, same park.
  • --permission-mode dontAskworks. No dialog. Session proceeds to process the first prompt immediately.

The name dontAsk is the opposite end of the spectrum from the dramatic-sounding flags, so users reach for --dangerously-skip-permissions first, hit the dialog, and have no clear signal that they should try dontAsk instead.

Requests (docs + UX, no code changes needed)

  1. Rename or alias --dangerously-skip-permissions to make clear it still requires interactive acceptance on first use. Proposed phrasing for the --help line:
    --dangerously-skip-permissions   Enable bypass mode; first run in a new session still requires interactive confirmation. For non-interactive sessions use --permission-mode dontAsk.
  2. Cross-reference dontAsk as the right flag for headless use in both --help and the permissions docs page. The existing docs describe the modes but don't steer users to the right choice for the scripted-sessions case.
  3. Detect the anti-pattern: if claude is started with --dangerously-skip-permissions + stdin not a TTY, either automatically route to dontAsk behaviour OR print a one-line hint ("Note: first-time bypass confirmation is interactive. For scripted use pass --permission-mode dontAsk.") before parking at the dialog.

Context

Found while deploying a 20-peer choir swarm on WSL2 where every peer is a detached GNU screen window with no TTY. With --dangerously-skip-permissions, all 20 peers park at the dialog and the swarm produces zero work. With --permission-mode dontAsk, all 20 peers process their charters immediately.

This is the secondary issue on top of #52501 (no pre-accept flag for the bypass dialog) — but even if #52501 is not fixed, clearer docs and a better flag-choice hint would have saved ~1h of diagnosis.

Environment

  • Claude Code v2.1.117
  • WSL2 Ubuntu, GNU screen (detached, no controlling TTY)

extent analysis

TL;DR

To avoid interactive prompts in autonomous sessions, use --permission-mode dontAsk instead of --dangerously-skip-permissions.

Guidance

  • When using --dangerously-skip-permissions, the session will still prompt for interactive confirmation on the first run, so it's not suitable for headless use.
  • For non-interactive sessions, use --permission-mode dontAsk to bypass permission checks without prompting.
  • To improve the user experience, consider renaming or aliasing --dangerously-skip-permissions to indicate that it still requires interactive acceptance on first use.
  • Add cross-references to dontAsk in the --help output and the permissions docs page to steer users towards the correct flag for scripted sessions.

Notes

The current implementation of --dangerously-skip-permissions may lead to confusion, as it does not fully bypass interactive prompts. The dontAsk mode is a better choice for autonomous sessions, but its name may not clearly convey its purpose.

Recommendation

Apply workaround: use --permission-mode dontAsk for headless sessions, as it provides the desired non-interactive behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING