Claude Code Slash Command Builder
Fill in the frontmatter and prompt, then copy or download the file. Output updates as you type.
Command
Save as
The context and agent fields are documented for skills. They may not apply to files in the older commands folder. unverified
Frontmatter fields
| Field | What it does |
|---|---|
description | What the command does. Claude reads it to decide when to use the skill on its own. |
argument-hint | Text shown in autocomplete, like [issue-number]. |
allowed-tools | Tools pre-approved while the command runs. Space or comma separated, patterns allowed. |
model | Override the session model for this command. |
disable-model-invocation | true means Claude never runs it by itself. |
user-invocable | false hides it from the / menu so only Claude can use it. |
context and agent | context: fork runs it in a subagent. agent picks the type. |
arguments | Named positional arguments, usable as $name in the body. |
Placeholders
$ARGUMENTS: everything typed after the command name.$0,$1: single arguments by position.!`cmd`: run a shell command first and insert its output.${CLAUDE_PROJECT_DIR}and${CLAUDE_SKILL_DIR}: paths for scripts.
Where files go
.claude/commands/name.md or .claude/skills/name/SKILL.md in a project, and the same under ~/.claude/ for all projects. Commit project files so the team shares them.
Checked against code.claude.com/docs/en/skills on 2026-10-20. The docs now lead with skills. unverified: whether every frontmatter field applies to files in .claude/commands.
FAQ
How do I create a custom slash command in Claude Code?
Create a markdown file at .claude/commands/name.md (project) or ~/.claude/commands/name.md (personal). The file name becomes /name. The body is the prompt.
What is the difference between a command and a skill?
A skill lives in a folder as .claude/skills/name/SKILL.md and can ship extra files such as scripts. Both can be invoked with /name. Skills also let Claude load them on its own based on the description. Check the skills docs for current behavior of the older commands folder.
How do I pass arguments to a slash command?
Use $ARGUMENTS for everything typed after the command name, or $0, $1, $2 for single positions. A skill can also declare named arguments in frontmatter and use $name.
How do I stop Claude from running a command by itself?
Set disable-model-invocation: true in the frontmatter. Then only you can run it with /name. Use it for deploys, commits, and anything with side effects.
How do I run a shell command inside a slash command?
Put the command in backticks after an exclamation mark, like !`git diff`. It runs before Claude sees the prompt and its output is inserted. Add the command to allowed-tools.