Bash permission prompts fire inconsistently even for commands matching permissions.allow / defaultMode: "dontAsk"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
A command that matches a configured permissions.allow rule (or that was already approved once) should be silently approved consistently. Currently, the same command — including read-only commands like git status/git diff and plain SQL SELECT queries — intermittently re-prompts for approval with zero changes to settings.json or the command itself in between attempts. Only one command pattern (python -m py_compile <file>) was reliable across every test.
What Should Happen?
A command that matches a configured permissions.allow rule (or that was already approved once) should be silently approved consistently. Currently, the same command — including read-only commands like git status/git diff and plain SQL SELECT queries — intermittently re-prompts for approval with zero changes to settings.json or the command itself in between attempts. Only one command pattern (python -m py_compile <file>) was reliable across every test
Error Messages/Logs
Steps to Reproduce
- Configure ~/.claude/settings.json with:
"permissions": {
"allow": ["Bash(git )", "Bash(cd )", "Bash(python *)"],
"defaultMode": "dontAsk"
}
- cd "<project path>" && git status --short
→ passes without a prompt.
- Run the exact same command again, no settings changes:
→ prompts.
- Repeat again:
→ prompts again.
Same instability seen on a read-only SQL SELECT query. Only python -m py_compile <file> was reliable every time. Full test matrix attached below.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.158
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗