Besides allow and deny, Claude Code permissions have a third list that gets less attention: ask.
{
"permissions": {
"ask": ["Bash(git push *)"]
}
}
With this rule, Claude Code always stops and asks before it runs git push with any arguments. That holds even in acceptEdits or bypassPermissions mode, and even when an allow rule like Bash(git *) would match the same command. Rules are checked in a fixed order: deny first, then ask, then allow. The first match wins, and a more specific allow rule doesn’t change that.
In my view ask is a good fit for commands that are fine most of the time but should never happen unseen. Pushing, deploying, npm publish. Deny would block them completely, which is too strict when you do want Claude to push after you’ve looked.
In dontAsk mode a matching call is refused instead of prompting, since nobody is there to answer.
The rule matches how the command is written. git -C . push starts differently and slips past Bash(git push *), and so does a push inside a script Claude runs. So treat ask as a seatbelt for the normal case, not as a security boundary. For that, the docs point to hooks and the sandbox.
Further reading: permissions.ask setting, Configure permissions