Skip to content
Beta Multi-model support (OpenAI, Gemini, and more) launching soon.

Slash command authoring standards

A slash command is a custom shortcut invoked by typing /<name> in Claude Code — the most direct way to package a prompt or workflow for repeat use. Commands ship standalone at commands/<name>.md or bundled at plugins/<plugin>/commands/<name>.md.

This page is two layers: Anthropic’s official guidance, then the RBA tailoring on top.

Source: Claude Code — Slash commands.

A slash command is a Markdown file. The filename (minus .md) is the command name; subdirectories create namespaces. Anthropic’s core guidance:

---
description: <one sentence> # shown in the /help list and the autocomplete menu
argument-hint: "<arg placeholders>" # shown in the autocomplete menu
allowed-tools: Read, Grep # tools the command may use (required if it runs bash)
model: sonnet # optional model override
disable-model-invocation: false # optional — prevent Claude auto-running it
---

None of these are required for the command to work, but description and argument-hint are strongly recommended for discoverability.

Anthropic supports three substitution mechanisms in the command body:

  • $ARGUMENTS — everything the user typed after the command name.
  • $1, $2, … — individual positional arguments.
  • ! prefix — a line beginning with ! is executed as a bash command and its output is inlined (requires allowed-tools to permit it).
  • @ prefix — @path/to/file inlines that file’s contents.

Skills supersede commands for most new work

Section titled “Skills supersede commands for most new work”

Anthropic positions Skills as the richer, auto-discoverable mechanism; slash commands remain the right tool for explicitly user-invoked shortcuts. Reach for a command when the user must deliberately type it, not when you want Claude to apply a methodology on its own.

RBA makes Anthropic’s “skills are richer” guidance a default. For new work, write a skill, not a command, unless one of two narrow cases applies:

  1. Strict invocation-only — the user MUST type the command and Claude should not auto-suggest it.
  2. Porting an existing one-shot prompt — skill structure would add no value.
SkillCommand
DiscoveryAuto-suggested from contextUser types /<name>
Metadataname, description, argument-hint, allowed-tools, supporting filesmostly description
ComposabilityCan compose with other skillsStandalone
Plugin/marketplaceFirst-classSupported, but legacy for new work

If neither narrow case applies, write a skill.

---
name: <command-name> # RBA: required — must match the filename (slug = name)
description: <one sentence> # required in practice — Anthropic's rules apply
primitive: true # optional — set only when this is a cross-cutting foundation primitive
argument-hint: "<placeholder>" # recommended when the command takes input
allowed-tools: Read, Grep # RBA: least-privilege, never bare Bash
---

Anthropic treats every field as optional; RBA requires name (slug = filename). Standalone commands may set optional facets (platforms, disciplines, outcomes, lifecycle, tags) or primitive: true for foundation primitives. Plugin-bundled commands inherit primitive from the plugin’s rba-meta.json and must not redeclare it. See plugin standards for the facet model.

  • Filename kebab-case.md; name field matches; body title prefixed with / — # /format-staged.
  • Don’t shadow a built-in (/help, /clear, /init, /review, …).

Same least-privilege rule as skills. Default-deny Bash; whitelist specific commands:

allowed-tools: Read, Grep, Bash(git status, git diff *)
  1. description and argument-hint are set so the command is discoverable (Anthropic).
  2. There is a documented reason this is a command and not a skill (RBA).
  3. Frontmatter has name; standalone commands may set optional facets or primitive: true (RBA).
  4. Slug = name = filename (RBA).
  5. The persona is domain-specific.
  6. allowed-tools is least-privilege with no bare Bash (RBA).
  7. The command name doesn’t shadow a built-in.
  8. The command produces useful output on a representative input.
  • A command that should be a skill (almost all of them — RBA default)
  • Command name shadowing a built-in
  • Using ! bash execution without declaring allowed-tools (won’t run — Anthropic requirement)
  • Open-ended Bash(*) allowlist
  • Generic persona
  • Missing argument-hint when the command takes input