# Permission Rule Wildcard

> A star in a rule that stands for any text, and where it goes matters.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** Bash(git log *), Bash(ls:*)

## Think of it like

It is like a blank in a form. Anything can go in that one spot.

## Definition

A wildcard is a star in a permission rule that stands for any text. In a Bash rule, everything before the first star must match as written. So Bash(git log *) covers only git log, but Bash(git *) covers every git command. A space before a final star counts: Bash(ls *) skips lsof, and Bash(ls*) does not.

## Example

Lucy first allowed Bash(git *). That let git push run too. She swaps it for Bash(git log *) and Bash(git diff *).

## Example code

```json
{
  "permissions": {
    "allow": ["Bash(git log *)", "Bash(git diff *)"]
  }
}
```

Allow two git commands, not all of git.

## Why it matters

One star in the wrong place can allow far more than you meant.

## Common mistake

Putting the star right after the program name. Put it after the subcommand.

## Three principles

- **Star is any text.** Spaces too.
- **After the subcommand.** git log *.
- **Space counts.** ls * vs ls*.

## Related terms

- [Bash Permission Rule](https://learn.benibix.com/term/ai/bash-permission-rule)
- [Permission Rule](https://learn.benibix.com/term/ai/permission-rule)

![Where the star goes in a Bash rule decides which commands it covers.](https://learn.benibix.com/diagrams/permission-wildcard.svg)

---

Source: https://learn.benibix.com/term/ai/permission-rule-wildcard
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
