Slash Command

Slash Command

Also called: 斜杠命令 · /command

A predefined instruction triggered by a leading `/`, letting a user invoke a fixed procedure or prompt template precisely without writing natural language.

User types/reviewExpands topreset promptAgent runsprocedure
Schematic (simplified)

Purpose

Natural language is convenient but ambiguous. A slash command collapses a common intent into a stable entry point: typing /review expands into a pre-written, structured instruction ("review the current diff, check each item against this standard…"). It removes the cost of re-describing the request each time and makes the behaviour reproducible. Commands often take arguments, e.g. /review src/.

Neighbouring concepts

A slash command is a trigger mechanism; what it triggers can be a prompt, a playbook, or loading a Skill. The difference from a Hook: a slash command is entered actively by the user, while a Hook runs automatically at an event point in the runtime.

Common misconceptions

  • A slash command is not itself a capability — it just turns a preset instruction/procedure into a shortcut.
  • Slash-command sets are not portable across tools (editor, chat client, CLI).

Related terms

Sources

  1. Anthropic — Claude Docs: Claude Code slash commands

Compiled 2026-08-29 · This glossary is compiled from public papers, official specifications, and common industry definitions, and is updated as the field evolves. Corrections welcome.