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
- Create a skill file with brackets in description:
``yaml``
---
name: my-skill
description: [TODO: Add description here]
---
- Start Claude Code
- Type
/followed by any characters (e.g.,/he) - 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
- Moved all
~/.claude/skills/*.mdto backup → error gone - Restored folders in batches of 3 → identified suspect batch
- Tested one at a time → found
trace-finder/SKILL.md - Inspected file → found
description: [TODO:...] - 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 descriptionThis issue has 3 comments on GitHub. Read the full discussion on GitHub ↗