[BUG] PowerShell allow rule with trailing wildcard does not pre-approve matching commands

Resolved 💬 2 comments Opened May 18, 2026 by alysson-kneat Closed May 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] 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.
  1. Run dotnet.exe build --help via the PowerShell tool. Prompts.
  1. Run dotnet.exe --version. Doesn't prompt.
  1. 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).

View original on GitHub ↗

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