Permission glob for Bash does not match when it should

Resolved 💬 8 comments Opened Mar 27, 2026 by Jodre11 Closed May 23, 2026

Summary

A Bash permission glob that should match a command does not, requiring explicit user approval despite the rule being configured.

Permission rule

In ~/.claude/settings.json:

"Bash(mkdir -p /tmp/claude-*)"

Command issued

mkdir -p /tmp/claude-$PPID

Which the shell expands to (for example):

mkdir -p /tmp/claude-91498

Expected behaviour

The glob mkdir -p /tmp/claude-* should match both the unexpanded form (mkdir -p /tmp/claude-$PPID) and the expanded form (mkdir -p /tmp/claude-91498). The * wildcard covers any suffix after claude-.

Actual behaviour

Claude Code prompts the user for explicit permission, as if the rule does not match.

Environment

  • Claude Code CLI (macOS, zsh)
  • Permission configured in global ~/.claude/settings.json
  • Model: Claude Opus 4.6

Notes

Other glob-based permissions in the same settings file (e.g. Bash(git *), Bash(gh *), Bash(dotnet build *)) work as expected. The issue appears specific to this pattern — possibly related to the -p flag or the /tmp/ path prefix, though that's speculative.

View original on GitHub ↗

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