claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude misinterprets skill "description" field using block scalar style

Open seh opened this issue 1 month ago • 2 comments

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?

If you create a skill in a SKILL.md file under a ~/.claude/skills/ directory and write a YAML document in the Markdown frontmatter, the YAML "description" field is itself a Markdown document that Claude reads to help it decide when to use the skill. If that "description" field uses the "flow scalar style", Claude interprets it as expected. However, the field instead uses the "block scalar style", Claude misinterprets the value as, say, "|" for the "literal style".

Compare these two SKILL.md files:

  • Flow Style Scalar
---
name: My Skill
description: "Use when ..."
---
# My Skill
...
  • Block Style Scalar
---
name: My Skill
description: |
  Use when ...
---
# My Skill
...

For the latter SKILL.md file, Claude's "available_skills" field for its Skill tool has a "description" element as follows:

<description>
  | (project, gitignored)
</description>

That shows that Claude is failing to parse the Markdown frontmatter as YAML properly.

What Should Happen?

Claude should parse the Markdown frontmatter as a YAML document with a full-featured parser that understands the block scalar style.

Error Messages/Logs


Steps to Reproduce

  1. Create a directory named ~/.claude/skills/my-skill, and within write a file named SKILL.md with the following content:
---
name: My Skill
description: |
Use when ...
---
# My Skill
...
  1. Start the claude program, and probe it for which skills it knows. Ask it to divulge the Skill tool's "available_skills" list.
  2. Inspect the "description" element in the XML document, and note that it lacks the YAML "description" field's intended value, and instead just contains the YAML literal style indicator (|).

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.22 (Claude Code)

Platform

Google Vertex AI

Operating System

macOS

Terminal/Shell

Other

Additional Information

Issue #9928 may be related, at least in the reported symptoms.

seh avatar Oct 29 '25 18:10 seh

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.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

I haven't seen any recent changes that would alleviate this problem.

seh avatar Dec 09 '25 13:12 seh