Skip to main content
Last Updated: March 2, 2026
Complete reference for Claude Code commands — command definitions, frontmatter fields, and all built-in slash commands.

Frontmatter Fields

Custom commands are defined in .claude/commands/<name>.md with optional YAML frontmatter.
description
string
required
What the command does. Shown in autocomplete and used by Claude for auto-discovery
argument-hint
string
Hint shown during autocomplete (e.g., [issue-number], [filename])
allowed-tools
string
Tools allowed without permission prompts when this command is active
model
string
Model to use when this command runs (e.g., haiku, sonnet, opus)

String Substitutions

Available inside command markdown for dynamic values:
VariableDescription
$ARGUMENTSAll arguments passed when invoking the command
$ARGUMENTS[N]Access a specific argument by 0-based index
$NShorthand 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

Invocation

Custom commands are invoked by typing /command-name in Claude Code’s interactive mode:

Direct Invocation

/command-name — Invoke directly from the command menu

With Arguments

/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

Example: Minimal Command

---
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}

Scope and Priority

When multiple commands share the same name, the higher-priority location wins:
LocationScopePriority
Project (.claude/commands/)This project only1 (highest)
Personal (~/.claude/commands/)All your projects2
Plugin (<plugin>/commands/)Where plugin is enabled3 (lowest)

Claude Commands

Session Management

SessionClear conversation history and start fresh
SessionCompress conversation to free context window. Optional instructions focus the compaction
SessionExit the REPL
SessionFork the current conversation into a new session
SessionRename the current session for easier identification
SessionResume a previous conversation by ID or name, or open the session picker
SessionRewind conversation and/or code to an earlier point
SessionResume a remote session from claude.ai (subscribers only)

Context & Usage

ContextVisualize current context usage as a colored grid with token counts
ContextShow token usage statistics and spending for the current session
ContextVisualize daily usage, session history, streaks, and model preferences
ContextShow plan usage limits and rate limit status (subscription plans only)

Model Configuration

ModelToggle fast mode — same Opus 4.6 model with faster output
ModelSwitch models (haiku, sonnet, opus) and adjust effort level
ModelEnter read-only planning mode — suggests approaches without making changes

Project & Memory

ProjectInitialize a new project with CLAUDE.md guide
MemoryView and edit CLAUDE.md memory files (user, project, and local scope)

Configuration

ConfigOpen the interactive Settings interface with search functionality
ConfigCustomize keyboard shortcuts per context, create chord sequences
ConfigView or update tool permissions
ConfigConfigure sandboxing with dependency status
ConfigSet up Claude Code’s status line UI
ConfigEnable shift+enter for newlines in IDE terminals
ConfigChange the color theme
ConfigEnable vim-style editing mode

Extensions

ExtensionsManage custom subagents — view, create, edit, delete
ExtensionsInteractive interface to manage hooks
ExtensionsConnect to IDE integration
ExtensionsManage MCP server connections — add, enable, list, get info, OAuth
ExtensionsManage plugins — install, uninstall, enable, disable, browse marketplaces
ExtensionsView available skills and their descriptions

Debug & Troubleshooting

DebugTroubleshoot the current session by reading the debug log
DebugCheck the health of your Claude Code installation
DebugGenerate a GitHub issue URL for reporting bugs or feedback
DebugShow all available slash commands and usage help
DebugList and manage background tasks
DebugList current TODO items

Export & Authentication

ExportCopy the last assistant response to clipboard
ExportExport the current conversation to a file or clipboard
AuthAuthenticate with Claude Code via OAuth
AuthLog out from Claude Code

Sources

Slash Commands

Official documentation for built-in slash commands

Interactive Mode

Guide to Claude Code’s interactive REPL

CHANGELOG

Latest updates and feature releases

Build docs developers (and LLMs) love