Skip to content

Skill loader executes markdown inline code as bash when content ends with ! #25792

@pomber

Description

@pomber

Bug

The skill loader incorrectly parses markdown inline code spans as bash commands when a backtick-enclosed span ends with ! and is followed by another backtick span on the same line.

Minimal Repro

Create a skill with this SKILL.md:

---
name: backtick-bug-repro
description: Minimal repro. Only use when explicitly called.
---

`!!` x `y` z

Invoke with /backtick-bug-repro. Result:

Error: Bash command failed for pattern "!` x `": [stderr]
(eval):1: command not found: x

No allowed-tools field is needed — the bug is in the skill loader itself, not tool permissions.

What's happening

The parser extracts the text from the ! at the end of the first inline code span, through the closing backtick, across the plain text, up to the next backtick — i.e. !`<text between spans>` — and tries to execute it as a bash command via eval.

Conditions

  • An inline code span ending with ! (e.g. `!!`, `a!` alone doesn't trigger — needs !!)
  • Followed by any text
  • Followed by another inline code span on the same line

Real-world impact

The /hike skill's SKILL.md contains walk syntax documentation:

...each step is a code fence with `!!` in the metastring. Tooltip content goes in `## !id` headings after the steps.

This makes the entire skill fail to load.

Environment

  • macOS (zsh)
  • Claude Code 2.1.42

Issue generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions