Skill files with backticked `!` characters trigger false bash permission check failures

Resolved 💬 3 comments Opened Jan 10, 2026 by clabby Closed Jan 10, 2026

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

  1. Create a skill file at ~/.claude/skills/my-skill/SKILL.md with content containing backticked code with !:
# My Skill

Use the `format!` macro for string formatting.
Rust doc comments use `//!` syntax.
  1. Invoke the skill with /my-skill
  1. 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:

  1. Actual bash command invocations
  2. Markdown inline code blocks (documentation)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗