4.1 β Anatomy of a slash command
Slash commands are Markdown files that Claude Code loads and runs as specialized prompts. Unlike native commands (/clear, /compact, /help), custom slash commands are files you create, share via Git, and use to encapsulate repeated workflows in a single invocation.
File format
A slash command is an .md file placed in one of the locations recognized by Claude Code. The file can start with an optional YAML frontmatter, followed by the Markdown content that forms the prompt:
```markdown
description: Génère un test unitaire pour le fichier cible
argument-hint: [file-path]
allowed-tools: Read, Write, Bash(npm:*)
Lis le fichier @$1 et génère un test unitaire complet.
Utilise le framework de tes