Create a custom slash command
mcp, agents & hooks
// what it does
Drop a Markdown file in .claude/commands/ (project) or ~/.claude/commands/ (personal) and its name becomes a slash command — deploy.md creates /deploy. The body is the prompt Claude runs; $ARGUMENTS injects everything the user typed, and $1, $2 grab positional args. Optional YAML frontmatter sets description, argument-hint, allowed-tools, and model. Subdirectories namespace the command.
// shell
$ .claude/commands/summarize.md$ /summarize src/app.tsx 150// gotcha
Custom commands have merged into skills: a file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and behave the same. Custom commands work in -p mode — include /name in the prompt string and Claude Code expands it before running.