Deny rules documentation unclear for multi-word commands like 'git push'

Resolved 💬 3 comments Opened Dec 23, 2025 by alexeyv Closed Feb 14, 2026

Problem

I cannot use the permissions documentation to reliably prevent git push commands.

Issues encountered:

  1. Documentation only shows single-word command examples like Bash(curl:*). There are no examples showing how to deny multi-word commands like git push.
  1. Your own Claude Code agent struggles to determine the correct syntax from the documentation. When asked how to deny git push, it gives conflicting interpretations of what the :* means and whether spaces are supported.
  1. Common git command variations bypass the deny completely:
  • git -C /path/to/dir push - options before the subcommand
  • git push origin branch && git push origin branch:main - command chaining
  • The docs mention these limitations but provide no solution

What I tried:

{
  "permissions": {
    "deny": [
      "Bash(git push:*)",
      "Bash(git:*push*)"
    ]
  }
}

Neither pattern blocked a simple git push origin main command.

Expected behavior:

  • Clear documentation on how to deny multi-word commands
  • Working examples for common use cases like preventing git push
  • If the prefix matching is too limited for these cases, document the recommended alternative (hooks?)

Environment:

  • Claude Code CLI
  • macOS

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗