Beginner 2 min read

Slash Commands

User-invoked shortcuts for common workflows

Prerequisites

  • Basic Claude Code usage

What You'll Learn

  • Understand how slash commands work
  • Know the built-in commands available
  • Create custom commands for your workflows
  • Use command arguments effectively

Claude Code~/my-project $/commit/commitCreate commit/review-prReview PR/helpShow help/memoryEdit memoryType "/" to invoke a slash command
01/05
0:00 / 0:23

Common Built-in Commands

/compact

Summarize conversation to free up context space

/review

Code review of changes with feedback and suggestions

/cost

Show current token usage and costs for the session

/model

Switch between Claude models (Opus, Sonnet, Haiku)

/doctor

Diagnose and fix common Claude Code issues

/clear

Clear conversation history and start fresh

Type /help to see all 35+ built-in commands including /agents, /hooks, /mcp, /plugin, /security-review, and more.

How Slash Commands Work

/deploy

You type

Find Command

.claude/commands/deploy.md

Full Prompt

Expanded to Claude

Slash commands are user-invoked—you explicitly type them to trigger the workflow. This is different from Skills, which Claude automatically discovers and uses based on context.

Where Commands Come From

Built-inClaude Code core35+ commands that come with Claude Code
Custom.claude/commands/Your own commands for project workflows
Plugin/plugin-name:commandCommands provided by installed plugins
MCP/mcp__server__promptPrompts exposed by MCP servers

Creating Custom Commands

Create commands by adding markdown files to .claude/commands/:

# .claude/commands/deploy.md

---
description: Deploy to production
argument-hint: <environment>
---

Deploy to $ARGUMENTS (default: production):

1. Run tests to ensure everything passes
2. Build the production bundle
3. Deploy using the deploy script
4. Verify deployment is live

Now /deploy staging expands the full prompt with "staging" substituted for $ARGUMENTS.

Commands vs Skills

Slash Commands

  • User-invoked: You type /command
  • Location: .claude/commands/
  • Simple markdown files
  • You must remember the command

Skills

  • Model-invoked: Claude uses automatically
  • Location: .claude/skills/
  • Can include supporting files
  • Discovered by semantic matching

💡 Pro Tips

  • 1.Type / and wait—autocomplete shows all available commands with descriptions.
  • 2.Use $ARGUMENTS, $1, $2 in custom commands to accept parameters.
  • 3.Personal commands go in ~/.claude/commands/, project commands in .claude/commands/.
  • 4.Commands from plugins use the format /plugin-name:command.

Master Claude Code faster

Get notified when new animated guides are released.

Subscribe to the newsletter