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
- Launch Claude Code with
--dangerously-skip-permissions
- Accept the bypass permissions dialog ("Yes, I accept")
- Claude writes
skipDangerousModePermissionPrompt: true to ~/.claude/settings.json
- Exit the session
- If
settings.json is reverted (e.g. via git-managed config sync, or any external process that restores the file), the setting is lost
- 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.
Description
When launching Claude Code with
--dangerously-skip-permissions, the "WARNING: Claude Code running in Bypass Permissions mode" dialog is shown on every launch unlessskipDangerousModePermissionPrompt: trueis persisted insettings.json.The CLI flag itself should be sufficient to skip this dialog — passing
--dangerously-skip-permissionsis already an explicit acceptance of the risks.Steps to Reproduce
--dangerously-skip-permissionsskipDangerousModePermissionPrompt: trueto~/.claude/settings.jsonsettings.jsonis reverted (e.g. via git-managed config sync, or any external process that restores the file), the setting is lost--dangerously-skip-permissions— the dialog appears againThis creates an infinite loop for users who manage
~/.claude/as a synced git repo: config sync pulls → overwritessettings.json→ setting lost → dialog shown → user accepts → setting written → never committed → next sync overwrites again.Expected Behavior
The
--dangerously-skip-permissionsCLI flag should skip the bypass permissions dialog without requiring a separately persistedskipDangerousModePermissionPromptsetting. The flag is already an explicit opt-in.Alternatively, if the dialog is intentionally required even with the flag, the
--dangerously-skip-permissionsflag should at minimum be checked as a source in thebn()function (it currently checksuserSettings,localSettings,flagSettings, andpolicySettingsbut the CLI flag doesn't appear to set it inflagSettings).Current Behavior
The dialog condition is:
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": truetosettings.jsonand ensure it's committed if the config directory is git-managed.Environment
--dangerously-skip-permissionsin previous versions.