Skip to content

Skill tool incorrectly parses markdown content as shell commands #13655

Closed as not planned

Description

@LeekJay

Bug Description

The Skill tool incorrectly interprets markdown content within skill files (.md) as shell commands, causing activation failures when the markdown contains certain characters like backtick-wrapped exclamation marks.

Steps to Reproduce

  1. Create a skill file (SKILL.md) with the following markdown content:
## Quick Reference Checklist

- [ ] No `!` non-null assertions
- [ ] All function parameters have types
  1. Try to activate the skill using the Skill tool

  2. Observe the error

Expected Behavior

The Skill tool should read and display the markdown content of the skill file without attempting to parse it as shell commands.

Actual Behavior

The Skill tool fails with this error:

Bash command permission check failed for pattern "!` non-null assertions
- [ ] All function parameters have types
...
`": This command uses shell operators that require approval for safety

Analysis

The tool appears to be:

  1. Extracting text between backticks in the markdown
  2. Interpreting the extracted text as potential bash commands
  3. Flagging the ! character (bash history expansion operator) as a dangerous shell operator

The problematic pattern is the markdown checkbox syntax combined with inline code:

- [ ] No `!` non-null assertions

Environment

  • Claude Code CLI
  • Windows 11
  • Skill file location: plugins/typescript-strict-typing/skills/typescript-strict-typing/SKILL.md

Workaround

Rewrite the markdown to avoid using backticks around the exclamation mark:

- No non-null assertion operator (the exclamation mark)

However, this workaround limits the ability to use standard markdown formatting in skill files.

Activity

  1. added
    bug
    has repro
    platform:windows
    on Dec 11, 2025
  2. github-actions commented on Dec 11, 2025

    @github-actions

    Found 2 possible duplicate issues:

    1. Skill tool incorrectly parses markdown content as Bash command #12762
    2. Skill loading executes inline bash patterns from documentation examples #12781

    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

  3. github-actions commented on Jan 10, 2026

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  4. added
    autoclose
    on Jan 10, 2026
  5. StudioLE commented on Jan 31, 2026

    @StudioLE

    I'm also experiencing this when documenting Rust conventions in a skill file.

    The original markdown had:

    modules need module-level docs (`//!`)

    The //! syntax tripped claude, possibly it treated it as bash history expansion

    My workaround was to remove the backticks entirely and just write it in plain English but it's rather concerning that claude isn't escaping input.


    Possibly related to: #13932

  6. removed
    autoclose
    on Jan 31, 2026
  7. techjoec commented on Feb 8, 2026

    @techjoec

    Still affected in v2.1.37 + systematic test results

    Confirmed this bug still occurs in Claude Code 2.1.37.

    New test results

    I created a test repo with skills containing various backtick-wrapped shell metacharacters to isolate the problem:

    Pattern Error?
    `echo hello`, `foo_bar`, `code` ✅ No
    `$HOME`, `$(whoami)`, `$` ✅ No
    `echo hello; echo world`, `;` ✅ No
    `home/user\file`, `\`, `\n` ✅ No
    `` `cat file grep foo``, ``
    `!` ❌ YES

    Only the exclamation mark ! in backticks triggers this error.

    Reproduction

    Test repo: github.com/techjoe/claude-skill-escape-testing

    Error on v2.1.37:

    Bash command failed for pattern "!` triggers history expansion. Use `": [stderr]
    /bin/bash: line 10: triggers: command not found
    

    This confirms the issue is specifically bash history expansion triggered by !, not a general problem with shell metacharacters in markdown.

  8. added
    stale
    on Feb 22, 2026
  9. github-actions commented on Mar 8, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  10. github-actions commented on Mar 17, 2026

    @github-actions

    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.

  11. locked as resolved and limited conversation to collaborators on Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbughas reproplatform:windowsstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions