Define frontmatter for custom slash commands in Claude Code
Learn how to define frontmatter metadata for custom slash commands in Claude Code.
Lesson Content
When you create a custom slash command, Claude Code pulls the first sentence of your prompt file as its description. That works, but we can do better by defining our own metadata using frontmatter.
Frontmatter is a header area at the top of a text file, wrapped between two sets of triple dashes. Inside those dashes, we define key-value pairs that control how our command behaves:
---
key1: value
key2: value
---
Claude Code looks for specific frontmatter properties:
| Property | Purpose | Default |
|---|---|---|
description |
Brief description of the comm... |
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.