[BUG] ask rule for specific file ignored when allow wildcard covers same path
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?
When a specific file is listed in the "ask" permission array, but the same file is also covered by a wildcard pattern in the "allow" array, the "allow" rule wins and Claude edits the file without asking for confirmation.
According to the documentation, rules are evaluated in order: deny → ask → allow, meaning "ask" should take precedence over "allow". In practice, the wildcard "allow" overrides the specific "ask".
Example configuration:
{
"permissions": {
"allow": [
"Edit(~/notes/journal/**)"
],
"ask": [
"Edit(~/notes/journal/archive.md)"
]
}
}
With this config, Claude edits archive.md without prompting.
What Should Happen?
The specific "ask" rule should take precedence over the broader wildcard "allow" rule, consistent with the documented deny → ask → allow evaluation order. Claude should prompt for confirmation before editing archive.md.
Error Messages/Logs
Steps to Reproduce
- Add to home/.claude/settings.json:
allow: ["Edit(home/notes/journal/**)"]
ask: ["Edit(home/notes/journal/archive.md)"]
- Ask Claude to edit archive.md.
- Observe it edits without prompting.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.78
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗