Claude consistently uses wrong wildcard syntax in allowed-tools and permission rules
Problem
Claude consistently generates the wrong wildcard syntax when writing allowed-tools in skill frontmatter or permission rules in settings.json. This has been happening for months.
What Claude writes (wrong):
allowed-tools:
- Bash(~/.claude/skills/my-skill/scripts/my-script.sh *)
"allow": ["Bash(npm *)"]
What it should write (correct):
allowed-tools:
- Bash(~/.claude/skills/my-skill/scripts/my-script.sh:*)
"allow": ["Bash(npm:*)"]
The correct syntax uses :* (colon-asterisk) for prefix wildcard matching, not * (space-asterisk). The space-asterisk form does not work — it's treated as a literal match looking for a command with a space and an asterisk character.
Impact
- Every time Claude generates a skill with
allowed-tools, the rules silently fail to match - Users get prompted for every command even though the skill explicitly declares permissions
- The user has to manually debug and fix the syntax every time
- This undermines the entire point of
allowed-toolsin skills
Root cause
The permission rule syntax (Bash(prefix:*)) is documented but Claude's training/system prompt apparently doesn't reinforce it strongly enough. Claude defaults to the more "natural" looking Bash(command *) form, which is wrong.
Suggestion
The system prompt instructions for permission rules should more prominently emphasize the :* colon syntax and explicitly warn against using space-asterisk. Ideally with a "WRONG vs RIGHT" example, similar to what exists for array merging in the update-config skill.
🤖 Generated with Claude Code
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗