claude-code - 💡(How to fix) Fix [BUG] PowerShell allow rule with trailing wildcard does not pre-approve matching commands

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example



---

{
    "permissions": {
        "allow": [
        "PowerShell(dotnet.exe build *)",
        "PowerShell(dotnet.exe --version)"
        ]
    }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

PowerShell(dotnet.exe build *) in the allow list doesn't pre-approve dotnet.exe build --help. I still get a permission prompt.

The exact-match form works fine. PowerShell(dotnet.exe --version) correctly suppresses the prompt for dotnet.exe --version, so the loader is reading the rules. Just the trailing-wildcard prefix doesn't match.

The docs say PowerShell rules use the same shape as Bash and trailing * matches "a space or end-of-string", so this should work.

What Should Happen?

PowerShell(dotnet.exe build *) should pre-approve any dotnet.exe build ... command without a prompt.

Error Messages/Logs

Steps to Reproduce

  1. Put this in ~/.claude/settings.json:
{
    "permissions": {
        "allow": [
        "PowerShell(dotnet.exe build *)",
        "PowerShell(dotnet.exe --version)"
        ]
    }
}
  1. Restart Claude Code.

  2. Run dotnet.exe build --help via the PowerShell tool. Prompts.

  3. Run dotnet.exe --version. Doesn't prompt.

  4. Pick option 2 on the prompt from step 3. Claude writes PowerShell(dotnet.exe build --help) (exact match) to settings.local.json. That exact command stops prompting, but dotnet.exe build --version-suffix foo still prompts.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.143 (Claude Code)

Platform

AWS Bedrock

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Also tried (none match):

  • PowerShell(dotnet build *) without .exe
  • PowerShell(dotnet.exe build:*) colon form

Bare-cmdlet rules like PowerShell(Get-ChildItem *) work as documented. Seems specific to native exes with a positional subcommand.

Related: #52606 (docs gap on PowerShell wildcard behavior).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] PowerShell allow rule with trailing wildcard does not pre-approve matching commands