Claude consistently uses wrong wildcard syntax in allowed-tools and permission rules

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Mar 24, 2026 · closed Mar 24, 2026

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-tools in 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

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/33746
  2. https://github.com/anthropics/claude-code/issues/27686

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

MartinLoeper · 6 months ago

omg just realized that apparently the syntax changed???? how to know that in an ecosystem where conventions stay for about 2 weeks max??

MartinLoeper · 6 months ago
github-actions[bot] · 6 months ago

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.