Skip to content

Slash commands

A slash command is a named, user-invokable shortcut. You type /<name> (or sometimes $<name>) mid-session and the CLI runs a predefined prompt, workflow, or built-in action — without you having to retype the whole thing.

Each tool ships a set of bundled commands (/model, /mcp, /diff, etc.) and lets you author your own. In Claude Code, the slash-command surface and the skills surface have largely merged in 2026 — every user-defined skill is also a slash command. In Codex, opencode, Cursor, and Copilot they’re still distinct primitives, though they overlap in use.

You have an incantation. Every time you start a fresh session in this repo, you type:

“Read the latest PR description from the release branch, summarise what changed, list any TODOs that have piled up, and check if there’s a migration we forgot to run.”

It’s eight lines. You’ve typed it forty times. You’ve copy-pasted it from a Notion doc thirty of those times. The other ten times you re-typed it from memory and got it slightly wrong. The instructions aren’t complex — they’re just yours, and the CLI has no way to know you keep wanting this exact thing.

A skill could pull this in when relevant, but the model has to decide it’s relevant. Sometimes you just want to say, deterministically, “run the release-check thing.” Type /release-check, the prompt gets expanded, the agent does the thing. No describing, no remembering, no waiting for the model to infer intent.

That’s the gap slash commands close: turning a thing you keep typing into a thing you keep invoking.

Real-world examples of user-defined slash commands:

  • Repo-specific check-ins/release-check, /pre-merge, /morning-status. Same prompt, same shape, every time.
  • Personal habits/tldr (“summarise what we’ve done this session in three bullets”), /sanity-check (“look at the diff and tell me what would break in prod”).
  • Standardised reviews/security-review <file>, /perf-review <file>. Argument substitution does the targeting.
  • Workflow shortcuts/spike <idea> (“scaffold a throwaway prototype for this idea”), /ship (“run the team’s full pre-ship checklist”).
  • Tone or persona switches/skeptic (“from here on, push back hard on any decision that seems convenient”), /junior (“explain the next change as if I’ve never seen this codebase”).
  • Side-effect commands (Claude Code, with disable-model-invocation: true) — things the model shouldn’t auto-trigger but you want one keystroke away: /deploy-dry-run, /db-snapshot.

The test: if it’s a prompt you’ve typed (or pasted) more than five times, it’s a slash command.

You want to…Reach forNot
Fire a predefined prompt by typing its nameSlash commandSkill
Have the agent reach for instructions on its own when the situation matchesSkillSlash command
Inject context on every turn of every sessionRulesSlash command
Run automatically on a CLI lifecycle eventHookSlash command
Pass arguments and have them substituted into the promptSlash command with $ARGUMENTS / $1$9Plain skill
Bundle a command + its skills + its MCP servers to sharePluginSlash command alone

In Claude Code the line is fuzzy — your user-defined skill is the slash command. Decide by intent: if the model should be able to invoke it on its own, you wrote a skill; if you want it to fire only on your keystroke, set disable-model-invocation: true and treat it as a slash-command-first artefact.

Bundled slash commands ship with Claude Code: /simplify, /batch, /debug, /model, /mcp, /context, /resume, /plan, /clear, and more.

User-defined slash commands are skills. A skill at .claude/skills/<name>/SKILL.md is invokable as /<name>. The legacy .claude/commands/<name>.md form still works but skills are the recommended path.

Plugin slash commands are namespaced: /my-plugin:review.

Argument passing: the $ARGUMENTS placeholder in the skill content is replaced with whatever the user typed after the command.

Invisible-by-default: set disable-model-invocation: true in frontmatter so Claude won’t auto-load the skill — you must type /<name> to use it. Good for skills with side effects.

AspectClaude CodeCodexopencodeCursorCopilot
User-defined slash commandsSkills (/<name>)Custom prompts + Skillscommands/.cursor/commands/ (1.6+).github/prompts/*.prompt.md
Bundled commandsYes (/simplify, /batch, …)Yes (/model, /review, …)YesYes (CLI built-ins + chat picker)Yes (/explain, /fix, /tests, …)
Plugin/namespaced/plugin:cmdNo (plugins can’t register slash commands today)Via Copilot Extensions
Arguments$ARGUMENTS$1$9, $ARGUMENTS, named ($FILE)$ARGUMENTS, $1, $2, …Limited (Unverified)Prompt-file frontmatter + body
Queueable for next turnNoYesNo (executes immediately)
Centrally managed for teamsPlugins / managed settingsTeam Commands (Enterprise)Org-level prompt files (Unverified)
  • In Claude Code, slash commands and skills are nearly the same thing — every user-invokable skill is reachable as a slash command. In Codex, opencode, Cursor, and Copilot they’re separate primitives that overlap in use.
  • “Commands” in opencode ≠ “commands” in Claude Code’s old .claude/commands/ (now mostly superseded by skills).
  • Cursor’s / (run something) vs @ (attach context) is a deliberate split — don’t confuse the two surfaces.
  • Copilot’s prompt files are the custom-command primitive; “chat participants” (@workspace, @vscode) are a different surface for scoping context.