Guide for creating Claude Code slash commands. Use when the user wants to create a new slash command, update an existing slash command, or asks about syntax and options.
View on GitHubFebruary 1, 2026
Select agents to install to:
npx add-skill https://github.com/GzuPark/claude-plugin-pack/blob/main/plugins/creators/skills/slash-command-creator/SKILL.md -a claude-code --skill slash-command-creatorInstallation paths:
.claude/skills/slash-command-creator/# Slash Command Creator Create custom slash commands for Claude Code to automate frequently-used prompts. ## Quick Start Initialize a new command: ```bash ./run.sh scripts/init_command.py <command-name> [--scope project|personal] # Namespaced command (creates frontend/build.md) ./run.sh scripts/init_command.py frontend/build --scope project ``` ## Command Structure Slash commands are Markdown files with optional YAML frontmatter: ```markdown --- description: Brief description shown in /help --- Your prompt instructions here. $ARGUMENTS ``` ### File Locations | Scope | Path | Shown as | |----------|---------------------- |-----------| | Project | `.claude/commands/` | (project) | | Personal | `~/.claude/commands/` | (user) | ### Namespacing Organize commands in subdirectories: - `.claude/commands/frontend/component.md` → `/component` shows "(project:frontend)" - `~/.claude/commands/backend/api.md` → `/api` shows "(user:backend)" ## Features ### Arguments **All arguments** - `$ARGUMENTS`: ```markdown Fix issue #$ARGUMENTS following our coding standards # /fix-issue 123 → "Fix issue #123 following..." ``` **Positional** - `$1`, `$2`, etc.: ```markdown Review PR #$1 with priority $2 # /review 456 high → "Review PR #456 with priority high" ``` ### Bash Execution Execute shell commands inline using the exclamation mark prefix. The allowed-tools field is required in frontmatter: ```markdown --- allowed-tools: Bash(git status:*), Bash(git diff:*) --- Current status: !`git status` Changes: !`git diff HEAD` ``` **Tip (Boris Cherny)**: Inline Bash pre-computes context, reducing round-trips with Claude: ```markdown # Current branch !`git branch --show-current` # Changed files !`git diff --name-only` # Based on above, create a PR with... ``` This pattern is especially powerful for `/commit-push-pr` style commands where context changes frequently. ### File References Include file contents with `@` prefix: ```markdown Rev