Skip to content

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

@richard-scott

Description

@richard-scott

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform:windowsIssue specifically occurs on Windows

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions