[BUG] --dangerously-skip-permissions flag should bypass the permissions mode dialog without requiring persisted setting

Status Open
Reported on v2.1.41
Maintainer reply None cached
Activity 6 comments · opened Feb 13, 2026

Description

When launching Claude Code with --dangerously-skip-permissions, the "WARNING: Claude Code running in Bypass Permissions mode" dialog is shown on every launch unless skipDangerousModePermissionPrompt: true is persisted in settings.json.

The CLI flag itself should be sufficient to skip this dialog — passing --dangerously-skip-permissions is already an explicit acceptance of the risks.

Steps to Reproduce

  1. Launch Claude Code with --dangerously-skip-permissions
  2. Accept the bypass permissions dialog ("Yes, I accept")
  3. Claude writes skipDangerousModePermissionPrompt: true to ~/.claude/settings.json
  4. Exit the session
  5. If settings.json is reverted (e.g. via git-managed config sync, or any external process that restores the file), the setting is lost
  6. Launch again with --dangerously-skip-permissions — the dialog appears again

This creates an infinite loop for users who manage ~/.claude/ as a synced git repo: config sync pulls → overwrites settings.json → setting lost → dialog shown → user accepts → setting written → never committed → next sync overwrites again.

Expected Behavior

The --dangerously-skip-permissions CLI flag should skip the bypass permissions dialog without requiring a separately persisted skipDangerousModePermissionPrompt setting. The flag is already an explicit opt-in.

Alternatively, if the dialog is intentionally required even with the flag, the --dangerously-skip-permissions flag should at minimum be checked as a source in the bn() function (it currently checks userSettings, localSettings, flagSettings, and policySettings but the CLI flag doesn't appear to set it in flagSettings).

Current Behavior

The dialog condition is:

if ((permissionMode === "bypassPermissions" || dangerouslySkipPermissions) && !skipDangerousModePermissionPrompt())

This means passing the flag triggers the dialog unless the persisted setting exists. The accept handler writes the setting to settings.json, but this is fragile — any external process that restores the file removes the acceptance.

Workaround

Manually add "skipDangerousModePermissionPrompt": true to settings.json and ensure it's committed if the config directory is git-managed.

Environment

  • Claude Code version: 2.1.41
  • OS: Windows 11 Pro
  • This is a regression — the dialog did not appear on every launch with --dangerously-skip-permissions in previous versions.

View original on GitHub ↗

6 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/12261
  2. https://github.com/anthropics/claude-code/issues/21974
  3. https://github.com/anthropics/claude-code/issues/17544

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

richard-scott · 6 months ago

No, those bugs are similar but different.

PaulRBerg · 6 months ago

can confirm this started happening in v2.1.42

it's a regression

STRML · 6 months ago

Yes - breaks some tooling (like claude-cells) and should be considered a regression

For now, we're using "skipDangerousModePermissionPrompt": true

EddyFromPoker · 6 months ago

defo a regression - breaks [work3s]( https://www.work-3s.com/ ) too

VXNCXNX · 5 months ago

I found the fix on my side: moving the project folder out of the .claude directory fixed it instantly. Works with v2.1.85

Example in PowerShell:
Move-Item "C:\\Dev\\.claude\\my-project" "C:\\Dev\\my-project"