Complete reference for Claude Code commands — command definitions, frontmatter fields, and all built-in slash commands.
| ← Back to Claude Code Best Practice |
Custom commands are defined in .claude/commands/<name>.md with optional YAML frontmatter.
| Field | Type | Required | Description |
|---|---|---|---|
description |
string | Recommended | What the command does. Shown in autocomplete and used by Claude for auto-discovery |
argument-hint |
string | No | Hint shown during autocomplete (e.g., [issue-number], [filename]) |
allowed-tools |
string | No | Tools allowed without permission prompts when this command is active |
model |
string | No | Model to use when this command runs (e.g., haiku, sonnet, opus) |
Available inside command markdown for dynamic values:
| Variable | Description |
|---|---|
$ARGUMENTS |
All arguments passed when invoking the command |
$ARGUMENTS[N] |
Access a specific argument by 0-based index |
$N |
Shorthand for $ARGUMENTS[N] (e.g., $0, $1) |
${CLAUDE_SESSION_ID} |
Current session identifier |
!`command` |
Dynamic context injection — shell command output replaces the placeholder before Claude sees it |
Custom commands are invoked by typing /command-name in Claude Code's interactive mode:
| Method | Description |
|---|---|
/command-name |
Invoke directly from the command menu |
/command-name [args] |
Pass arguments that map to $ARGUMENTS |
| Autocomplete | Type / to see all available commands with descriptions |
| Subdirectories | Commands in subdirectories use /subdir:command-name |
---
description: Fetch weather data for Dubai and create an SVG weather card
model: haiku
---
Fetch the current temperature for Dubai, UAE and create a visual SVG weather card.---
description: Fix a GitHub issue by number, following team coding standards
argument-hint: [issue-number]
allowed-tools: Read, Edit, Write, Bash(gh *), Bash(npm test *)
model: sonnet
---
Fix GitHub issue $0 following our coding standards.
## Context
- PR diff: !`gh pr diff`
- Issue details: !`gh issue view $0`
## Steps
1. Read the issue description
2. Understand the requirements
3. Implement the fix
4. Write tests
5. Create a commit
Session: ${CLAUDE_SESSION_ID}When multiple commands share the same name, the higher-priority location wins:
| Location | Scope | Priority |
|---|---|---|
Project (.claude/commands/) |
This project only | 1 (highest) |
Personal (~/.claude/commands/) |
All your projects | 2 |
Plugin (<plugin>/commands/) |
Where plugin is enabled | 3 (lowest) |
Built-in slash commands available in Claude Code's interactive mode:
Custom commands defined in .claude/commands/ for this project:
| Command | Description | Model |
|---|---|---|
weather-orchestrator |
Fetch weather data for Dubai and create an SVG weather card | haiku |
workflows/best-practice/workflow-claude-subagents |
Track Claude Code subagents report changes and find what needs updating | — |