Video Lesson: Define frontmatter for custom slash commands in Claude Code

Define frontmatter for custom slash commands in Claude Code

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

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...

Premium content

Enroll to unlock the full content and all course materials.

👋
Maggie

Log in to start chatting!

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Comments

Want to comment on this lesson?

Enroll in this course to leave comments.