Skip to content

Claude settings.json skipDangerousModePermissionPrompt lost after config overwrites #446

@voyax

Description

@voyax

Summary

When editing certain files, Claude Code prompts the user with a dangerous-file confirmation dialog, blocking the input pipeline and preventing heartbeat delivery (causing a liveness timeout).

Root Cause

~/.claude/settings.json is missing the skipDangerousModePermissionPrompt: true key.

The zylos runtime adapter (claude.js) writes this flag during launch()_ensureOnboardingComplete(). However, if settings.json is later overwritten by other operations (e.g., hooks updates, update-config skill), this key gets lost.

When a session rotates via /clear (which does not call launch() again), the flag is not re-applied, leaving the user exposed to the confirmation prompt.

Why newer Claude versions are more affected

Newer Claude Code versions added additional confirmation layers for certain scenarios (e.g., the Write tool writing to files that haven't been read). The --dangerously-skip-permissions CLI flag no longer fully bypasses these prompts.

Additional finding: .claude/ directory has hardcoded protection

howard.zhou reports: Even with skipDangerousModePermissionPrompt: true set, modifying files inside ~/.claude/ still triggers a user authorization prompt after Claude Code restart. This suggests Claude Code has a separate, hardcoded write-protection layer for its own config directory that is not controlled by this flag.

This means:

  1. skipDangerousModePermissionPrompt only covers "dangerous mode" prompts for general files
  2. .claude/ directory writes (e.g., hooks, settings, skills) require a different bypass mechanism
  3. May need to use settings.json permissions allowlist or a different authorization approach to pre-authorize .claude/ directory writes

Impact

  • The confirmation dialog blocks the input box
  • Heartbeat commands cannot be delivered while the dialog is active
  • This triggers a false liveness timeout → recovery loop → potential restart

Expected Fix

  1. Resilient write: When any code path modifies settings.json, it should preserve existing keys (merge, not overwrite)
  2. Session-level guard: Check for skipDangerousModePermissionPrompt not only at launch() but also at session start (e.g., after /clear)
  3. .claude/ directory pre-authorization: Find and apply the correct mechanism to allow writes to ~/.claude/ without prompts (may require permissions allowlist in settings.json)
  4. Defensive read-back: After writing settings.json, verify the key is still present

Workaround

Manually add "skipDangerousModePermissionPrompt": true to ~/.claude/settings.json. This resolves some but not all prompt scenarios (.claude/ directory writes still prompt).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions