Skill files with backticked `!` characters trigger false bash permission check failures
Description
When loading a skill file (SKILL.md) that contains inline code blocks with ! characters (common in Rust documentation), Claude Code's bash permission checker incorrectly interprets the content as potential bash commands and blocks skill loading.
Steps to Reproduce
- Create a skill file at
~/.claude/skills/my-skill/SKILL.mdwith content containing backticked code with!:
# My Skill
Use the `format!` macro for string formatting.
Rust doc comments use `//!` syntax.
- Invoke the skill with
/my-skill
- Observe the error:
Bash command permission check failed for pattern "!` macro for string formatting...": This command requires approval
Expected Behavior
Skill files should load without triggering bash permission checks on their markdown content. Inline code blocks in markdown are documentation, not commands.
Actual Behavior
The permission checker scans the skill file content and incorrectly identifies text inside backticks containing ! as potential bash commands (since ! is used for bash history expansion).
Workaround
Replace ! with HTML entity ! inside backticks:
- `
format!→format!` - `
//!→//!`
Note: Backslash escaping (\!) does not work - the permission checker appears to strip backslashes before scanning.
Environment
- Claude Code CLI
- macOS (Darwin 25.2.0)
- Skill file location:
~/.claude/skills/*/SKILL.md
Impact
This affects any skill file documenting:
- Rust macros (
println!,format!,vec!,bail!, etc.) - Rust doc comments (
//!,/*!) - Rust trait bounds (
!Send,!Sync) - Any other language/syntax using
!in code examples
Suggested Fix
The bash permission checker should not scan markdown content in skill files, or should properly distinguish between:
- Actual bash command invocations
- Markdown inline code blocks (documentation)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗