Skip to content

"Don't ask again" permission not persisted when project settings.json doesn't exist #28905

Description

@verndemille

Description

When selecting "Yes, and don't ask again for: lsof:*" (or any Bash command pattern) in the permission prompt, the permission is not persisted. The very next time the same command is invoked, the permission prompt appears again.

Root Cause

The project-level settings file at ~/.claude/projects/<project-path>/settings.json does not exist, and the "don't ask again" flow does not appear to create it. The permission is only held in-memory for that single turn and is lost immediately.

Expected Behavior

Selecting "Yes, and don't ask again" should:

  1. Create the project-level settings.json file if it doesn't already exist
  2. Persist the permission pattern (e.g., Bash(lsof:*)) to that file
  3. Not re-prompt for matching commands in the same session or future sessions

Actual Behavior

  • Permission prompt reappears on the very next invocation of the same command
  • No settings.json file is created in the project settings directory
  • The directory exists (~/.claude/projects/-Users-vdemille-GitHub/) with session logs but no settings.json

Steps to Reproduce

  1. Start Claude Code in a directory where ~/.claude/projects/<project-path>/settings.json does not exist
  2. Trigger a Bash command that requires permission (e.g., lsof -i :3000)
  3. Select "Yes, and don't ask again for: lsof:*"
  4. Trigger another lsof command
  5. Observe: permission prompt appears again

Environment

  • macOS (Darwin 25.3.0)
  • Claude Code CLI
  • Global settings.json exists and works fine at ~/.claude/settings.json
  • Project settings directory exists but contains no settings.json

Workaround

Manually add the permission to the global ~/.claude/settings.json:

{
  "permissions": {
    "allow": [
      "Bash(lsof *)"
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions