Skip to content

writing-skills: Add guidance on avoiding exclamation marks in inline code spans #451

@vargose

Description

@vargose

Problem

The writing-skills skill comprehensively covers skill authoring (CSO, structure, TDD, token efficiency) but doesn't warn about a parser landmine that silently breaks skills at load time: exclamation marks (!) inside inline code spans (single backticks) cause the Skill tool to reject the entire skill.

Claude Code's Skill loader scans inline code for bash operators. When it encounters ! between backticks, it interprets it as bash history expansion and fails with:

Bash command permission check failed for pattern "!` ...": This command uses shell operators that require approval for safety

This affects any skill documenting shell commands, PromQL queries, TypeScript non-null assertions, or anything else using ! in inline code.

Related Claude Code Issues

This is a known, unfixed bug with 7+ duplicate reports:

All still open as of Feb 2026.

Real-World Example

I wrote a Prometheus querying skill documenting PromQL's != and !~ operators. Lines like:

**The `!=` and `!~` operators in PromQL WILL BREAK in bash.**

...caused the entire skill to fail to load. The fix was spelling out operators in prose and keeping exact syntax only in fenced code blocks:

**The PromQL not-equal (written as exclamation-equals) and negative-regex (written as exclamation-tilde) operators WILL BREAK in bash.**

Suggested Addition

A "Character Safety" section in writing-skills, perhaps under "Common Mistakes" or as a new gotcha:

Never use ! inside inline code spans (single backticks). Claude Code's Skill loader scans inline code for bash operators and will reject skills containing exclamation marks in backtick-quoted text (anthropics/claude-code#13655, #12762, #12781). This silently prevents the skill from loading — there's no partial load or warning.

Workarounds:

  • Spell out the character in prose: "exclamation-equals" instead of `!=`
  • Keep exact syntax in fenced code blocks (triple backticks) — these are safer but not guaranteed safe when ! is directly adjacent to a backtick
  • Avoid ! adjacent to backticks even in fenced blocks (the !backtick` pattern triggers bash command substitution parsing per #12781)

This would save future skill authors from the same debugging session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-codeClaude Code (Anthropic CLI) issuesenhancementNew feature or requestupstream-bugBug in upstream dependency (e.g. Claude Code)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions