Bash allowlist patterns with wildcards don't match multi-argument rm commands
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 4 comments · opened May 18, 2026 · closed May 18, 2026
Summary
Allowlist patterns like Bash(rm -rf "/Users/path/*) in settings.json do not suppress permission prompts when the rm command is called with multiple path arguments.
Steps to reproduce
- Add
"Bash(rm -rf \"/Users/morganturner/PKA/*)"to theallowlist in.claude/settings.json - Run a bash command with multiple arguments:
````
rm -rf "/Users/morganturner/PKA/Team Inbox/alvin/folder-a" "/Users/morganturner/PKA/Team Inbox/alvin/folder-b"
- Permission prompt still appears, even though both paths match the wildcard pattern.
Expected behavior
Any rm -rf command where all arguments are paths under /Users/morganturner/PKA/ should be auto-allowed without a prompt.
Actual behavior
Multi-argument commands trigger a manual permission prompt even when every argument matches the allowlist pattern.
Workaround
Run each rm as a separate command, or have the user execute the commands directly in the terminal.
🤖 Filed from Claude Code session
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Root Cause Analysis & Fix Proposal
Root Cause: Allowlist Pattern Matching Only Checks First Argument
The bash allowlist pattern matching logic in claude-code's permission system only matches against the entire command string as a single unit rather than checking each argument individually against the wildcard pattern.
When the allowlist contains:
The matching logic compares the full command string:
Against the pattern. The wildcard
*in the pattern is designed to match a single path argument, but the multi-argument command has additional quoted paths that fall outside the pattern's scope.Likely code path (
src/permissions/bash-allowlist.tsor similar):Fix Proposal
Fix: Argument-aware allowlist matching (~80 LoC)
Test Cases
Estimated Effort
Pricing
| Tier | Price | Scope |
|------|-------|-------|
| Quick Fix | $500 | Root cause + fix patch |
| Standard | $1,000 | + Test cases + PR |
| Premium | $1,500 | + Edge case handling + docs |
Cross-sell
Bundle with other claude-code permission issues (#60311, #60310) for $3,000+
Closing — tracking this internally instead.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.