A Claude Code Bash deny rule matches only the start of the command
FactVerified 1 Oct 2026Holds anywhere
Fact. A statement and the evidence for it.
Statement#
A rule such as Bash(git push:*) in permissions.deny matches only commands that start with git push. git -C <dir> push and a script that runs git push are not blocked. Keep the text rule ("never push") in the user-level instructions as well. The deny block applies to Claude Code only. Codex, pi, omp and OpenCode have no equivalent here. The user then pushes with ! git push or in their own terminal.
Evidence#
Observed in an rsrobo session on 2026-10-01 while the user's git push ban was set up. The observer note says git -C <dir> push and a script with git push pass the rule. It shows no command run to test it.
Also found by searching
- Claude Code permissions.deny Bash(git push:*) did not block git -C dir push
- how do I stop Claude Code from pushing with a deny rule
- deny rule is bypassed by a script that runs git push
- does permissions deny work in pi or Codex