Bash permission prompts fire inconsistently even for commands matching permissions.allow / defaultMode: "dontAsk"

Status Fixed / completed
Reported on v2.1.158
Maintainer reply None cached
Activity 1 comment · opened Jul 21, 2026 · closed Aug 17, 2026

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

  1. Configure ~/.claude/settings.json with:

"permissions": {
"allow": ["Bash(git )", "Bash(cd )", "Bash(python *)"],
"defaultMode": "dontAsk"
}

  1. cd "<project path>" && git status --short

→ passes without a prompt.

  1. Run the exact same command again, no settings changes:

→ prompts.

  1. 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗