Bash permission patterns do not support ** glob — impossible to scope by both path depth and file extension

Resolved 💬 1 comment Opened Jun 9, 2026 by jdime Closed Jun 10, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Description

When configuring permissions.allow in settings.json, the Bash() pattern matcher does not support ** (recursive glob). This makes it impossible to write a rule that enforces both a path scope and a file extension when files live at variable
subdirectory depths.

Example use case:
Allow cp of .py files from any subdirectory of a source repo to a fixed output directory:

"Bash(cp /Users/me/repos/**/*.py /Users/me/repos/claude_outputs/**)"

This rule is silently ignored — the permission prompt still fires. The ** is not matched against the actual command path.

Workaround and its cost:

Replacing ** with a plain * suffix works:

"Bash(cp /Users/me/repos/my-repo* /Users/me/repos/claude_outputs*)"

But this forces a choice between:

  • Enforcing file extension (.py) — not possible across nested paths
  • Enforcing path scope — possible, but allows any file type (which I can't use because I can allow to cp some file types outside it's original repo).

There is no way to enforce both at once.

Proposed Solution

Expected behaviour:

** in Bash() permission patterns should match any sequence of path segments (including zero), consistent with how ** works in .gitignore, minimatch, and standard glob libraries.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Allow cp of .py files from any subdirectory of a source repo to a fixed output directory:

"Bash(cp /Users/me/repos/**/*.py /Users/me/repos/claude_outputs/**)"

This rule is silently ignored — the permission prompt still fires. The ** is not matched against the actual command path.

Additional Context

Environment:

  • Claude Code CLI (darwin)
  • settings.json global permissions

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗