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:
- Create the project-level
settings.json file if it doesn't already exist
- Persist the permission pattern (e.g.,
Bash(lsof:*)) to that file
- 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
- Start Claude Code in a directory where
~/.claude/projects/<project-path>/settings.json does not exist
- Trigger a Bash command that requires permission (e.g.,
lsof -i :3000)
- Select "Yes, and don't ask again for: lsof:*"
- Trigger another
lsof command
- 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 *)"
]
}
}
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.jsondoes 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:
settings.jsonfile if it doesn't already existBash(lsof:*)) to that fileActual Behavior
settings.jsonfile is created in the project settings directory~/.claude/projects/-Users-vdemille-GitHub/) with session logs but nosettings.jsonSteps to Reproduce
~/.claude/projects/<project-path>/settings.jsondoes not existlsof -i :3000)lsofcommandEnvironment
settings.jsonexists and works fine at~/.claude/settings.jsonsettings.jsonWorkaround
Manually add the permission to the global
~/.claude/settings.json:{ "permissions": { "allow": [ "Bash(lsof *)" ] } }