Bug: Parser crashes on bracket characters in skill description

Resolved 💬 3 comments Opened Jan 8, 2026 by nazt Closed Jan 11, 2026

Summary

Claude Code crashes with $.description.split is not a function when a skill file has bracket characters [...] in the YAML frontmatter description field.

Error Message

TypeError: $.description.split is not a function. (In '$.description.split(" ")', '$.description.split' is undefined)
    at <anonymous> (/$bunfs/root/claude:2995:27399)

Steps to Reproduce

  1. Create a skill file with brackets in description:

``yaml
---
name: my-skill
description: [TODO: Add description here]
---
``

  1. Start Claude Code
  2. Type / followed by any characters (e.g., /he)
  3. Error occurs during autocomplete

Expected Behavior

  • Parser should handle special characters in description
  • Or provide helpful error message on startup

Actual Behavior

  • Crashes during autocomplete
  • Unhelpful error message
  • No indication which file caused the issue

Root Cause Analysis

The YAML parser interprets [...] as an array, returning an array object instead of a string. Then description.split(" ") fails because arrays don't have .split().

# Parsed as array, not string:
description: [TODO: something]

# Works correctly:
description: "TODO: something"
description: Add description here

Suggested Fix

// Before
const words = description.split(" ");

// After - handle non-string descriptions
const desc = typeof description === 'string' ? description : String(description || '');
const words = desc.split(" ");

Debugging Approach Used

  1. Moved all ~/.claude/skills/*.md to backup → error gone
  2. Restored folders in batches of 3 → identified suspect batch
  3. Tested one at a time → found trace-finder/SKILL.md
  4. Inspected file → found description: [TODO:...]
  5. Fixed brackets → error resolved

Environment

  • Claude Code: Latest (2026-01-08)
  • OS: macOS Darwin 25.2.0

Workaround

Ensure all description fields in YAML frontmatter are plain strings without brackets:

# Bad
description: [TODO: something]
description: [array, of, words]

# Good
description: "TODO: something"
description: Plain text description

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗