[BUG] Skill parser executes `!` inside markdown backticks as bash commands
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When a skill's SKILL.md file contains the exclamation mark character inside inline code backticks (e.g., documenting the bash execution feature), the parser incorrectly interprets it as a bash command and tries to execute the surrounding text.
Example: Having this line in a skill file:
- Use
!prefix for bash commands
Results in the parser trying to execute "prefix" as a shell command, producing errors like:
(eval):1: command not found: prefix
(eval):2: command not found: Arguments
The exclamation mark bash execution feature should only trigger on actual lines starting with !, not on ! characters inside markdown inline code backticks or fenced code blocks.
What Should Happen?
The parser should respect markdown formatting and only trigger bash execution for ! at the start of a line outside of code formatting:
!inside inline code backticks should be treated as text!inside fenced code blocks should be treated as text- Only bare
!at line start should trigger bash execution
Error Messages/Logs
Error: Bash command failed for pattern "!` prefix
- Arguments usage is consistent
- Content quality and length
Fix any errors before proceeding. Warnings are suggestions for improvement.
Step 5: Create the File
Write the command file to the appropriate location:
- Project scope: `": [stderr]
(eval):1: command not found: prefix
(eval):2: command not found: Arguments
(eval):3: command not found: Content
(eval):5: command not found: Fix
usage: write user [tty]
(eval):11: no matches found: **Project
The (eval):N: command not found: lines show zsh trying to execute markdown text as shell commands.
Steps to Reproduce
- Create a skill file at ~/.claude/skills/example/SKILL.md
- Include documentation text with
!inside backticks, e.g.:
- Use
!prefix for bash commands
- Invoke the skill
- Observe the parser attempts to execute text after
!as bash commands
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗