[Feature Request] Tool allow patterns should support wildcard matching for command arguments
Status Fixed / completed
Reported on v2.1.80
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Mar 21, 2026 · closed Mar 23, 2026
Bug Description
currently the way claude uses some tools clashes with the way the allows work making them redundant. For example i have "Bash(git status:*)" in my allows, but cluade always calls uses git with the -C --> git -C path/to/the/thing status, which doesn't hit on the allow i've put in. the only way arround this currently is for me to tell claude to not use the -C (which to be honest i don't mind better to be precise). I'm unsure if this is a bug or feature request, guess that depends on how you solve it.
ethier:
- fix claude not to use the -C so the allows work (there are other tools where this is an issue too so not real fix)
- leave how it uses git but allow for argument wild carding before the :, ie, Bash(git -C %s status:)
- allow for a variables in the allow, so we can vairable it out, ie, Bash(git -C $PROJECT_PATH status:*)
- something else cooler :)
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 2.1.80
- Feedback ID: 718f29cf-fb0f-4347-ad30-b78ba42f13e6
4 Comments
This is a common friction point — Claude Code adds flags like
-Cthat change how the command looks to the permission matcher.Workaround with a PreToolUse hook:
This matches
git status,git -C /path status,git -C /path log --oneline, etc. The regex handles the optional-C <path>that Claude inserts.See also #36873 for a related trailing-wildcard matching issue.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
same as https://github.com/anthropics/claude-code/issues/27803
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.