Claude Code custom slash commands: make your own

Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.

Contents

A Claude Code custom slash command is a Markdown file. Save a prompt as .claude/commands/review.md and typing /review sends it. Since Anthropic merged commands into skills, .claude/skills/review/SKILL.md does the same job and can carry extra files. Frontmatter adds a description, arguments, allowed tools and a model.

We use saved commands for the prompts we would otherwise paste ten times a day: review this diff, write the release note, fix this issue. Here is how to make one, with every field Anthropic documents as of 23 October 2026.

Commands and skills: what changed#

Anthropic's slash command docs say it plainly: "A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and work the same way. Your existing .claude/commands/ files keep working."

So you can pick either shape:

Command file Skill
Where .claude/commands/<name>.md .claude/skills/<name>/SKILL.md
For every project on your computer (not documented for command files) ~/.claude/skills/<name>/SKILL.md
Extra files beside it No Yes, in the skill's folder
Claude can load it by itself Yes, unless you turn it off Yes, unless you turn it off

A single file is enough for a saved prompt. Reach for a skill when the command needs a script or a template next to it. Our guide on skills, subagents and MCP covers when each fits.

How to make your first command#

  1. In your project, create the folder .claude/commands/.
  2. Add a file named after the command, for example review.md.
  3. Write the prompt as plain Markdown.
  4. Start Claude Code in that project and type /review.

A minimal file:

markdown
Review the staged changes. List bugs first, then risky changes,
then style notes. Quote file and line for each.

Commit the folder and everyone on the project gets the same command. That's the main reason to prefer a command over a note in CLAUDE.md: CLAUDE.md loads into every session, a command loads only when you ask for it.

Frontmatter fields you can use#

Frontmatter sits between --- lines at the top of the file. Claude Code reads it only when the opening --- is the first line. Every field is optional; the docs recommend at least a description.

Field What it does
description What the command does and when to use it. Without it, the first non-empty line is used
argument-hint The hint shown while you type, such as [issue-number]
allowed-tools Tools Claude may use without asking during the turn the command starts, such as Bash(git add *). The grant ends with your next message
model The model for that turn only. It isn't saved to your settings
disable-model-invocation true means only you can start it; Claude won't load it by itself

Field names must match exactly. The docs note that an unknown field is ignored without an error, so a typo fails quietly.

Arguments: $ARGUMENTS, $0 and $1#

Everything you type after the command name is its argument:

  • $ARGUMENTS is all of it.
  • $0, $1, $2 are single arguments, counted from zero.
  • Quotes group words: /migrate "Search Bar" JavaScript TypeScript gives $0 the value Search Bar.

If the file has no placeholder, Claude Code adds ARGUMENTS: <what you typed> to the end of the prompt.

The example from Anthropic's docs, slightly trimmed:

markdown
---
description: Fix a GitHub issue
argument-hint: [issue-number]
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS following our coding standards.

/fix-issue 123 sends "Fix GitHub issue 123 following our coding standards."

Put live output in the prompt with !#

A line starting with !`command` runs that shell command before the prompt goes to Claude, and its output replaces the line:

markdown
## Context
- Staged diff: !`git diff --staged`
- Branch: !`git branch --show-current`

Write a commit message for the staged diff.

Three rules from the docs are worth knowing before you rely on it:

  • A command that fails (exits non-zero) cancels the whole slash command. Claude never sees the prompt.
  • The shell commands are checked against your permission rules. One that isn't pre-approved cancels the command instead of asking.
  • An admin can switch this off with "disableSkillShellExecution": true.

Group commands in folders#

Subfolders become a prefix with a colon. .claude/commands/frontend/component.md is /frontend:component. Useful once a project has more than a handful.

Commands worth making first#

Start with the prompts you already repeat. Three pay off in most repositories.

  • /review runs your review checklist on the staged diff (see above).
  • /release-note summarises git log since the last tag into your changelog's format.
  • /fix-issue reads the issue with gh issue view $ARGUMENTS, writes a failing test, fixes it and runs the tests.

Keep each one short. A command is still a prompt, and the advice in our guide to writing prompts for Claude Code applies: say what done looks like and how to check it.

Using your commands in Shuriken#

Shuriken runs Claude Code itself, so your project's .claude/commands/ and .claude/skills/ folders work the same in a Shuriken chat as in the terminal. Commit them and every chat's worktree checks them out too. If a chat moves to another of your accounts when one nears its limit, the commands come along, because they belong to the project, not the account.

Sources

  1. Claude Code docs: Slash commands (custom commands and skills) (accessed 23 October 2026)
  2. Claude Code docs: Best practices (Create skills) (accessed 23 October 2026)

Frequently asked questions

Where do custom slash commands go in Claude Code?

Put a Markdown file in .claude/commands/ in your project, for example .claude/commands/review.md for /review. A skill at .claude/skills/review/SKILL.md makes the same command and can add supporting files.

Are custom slash commands the same as skills now?

Anthropic's docs say custom commands have been merged into skills. A command file and a skill with the same name both create the same /command, and existing .claude/commands files keep working.

How do I pass arguments to a custom command?

Use $ARGUMENTS for everything after the command, or $0, $1 and so on for single arguments. Quoted words count as one argument, so /migrate "Search Bar" JS TS gives $0 the whole name.

Can a slash command run a shell command first?

Yes. A line with !`git status --short` runs before the prompt is sent, and its output takes the line's place. If that command fails, the whole command is cancelled.

How do I stop Claude from running my command by itself?

Add disable-model-invocation: true to the file's frontmatter. Then only you can start it by typing the slash command.

Free tools