Reference Guide

Claude Code Commands

The complete reference for every slash command available in Claude Code. Learn built-in commands, create custom commands, and build efficient workflows with Claude Code commands.

What Are Claude Code Commands?

Claude Code commands are slash commands that you type directly in the Claude Code CLI to perform specific actions. Every command starts with a forward slash (/) followed by the command name. When you type a slash command, Claude Code executes the action immediately rather than treating it as a conversational prompt.

Think of Claude Code commands as the control layer for your AI coding assistant. While natural language prompts tell Claude what to build, slash commands control how the tool itself behaves. They let you manage your session, switch models, control permissions, and trigger specific workflows without leaving the terminal.

Claude Code ships with a set of built-in slash commands that cover the most common operations. These include session management commands like /clear and /compact, configuration commands like /model and /permissions, and utility commands like /cost and /review.

Beyond built-in options, Claude Code supports custom slash commands that you define yourself. By adding markdown files to the .claude/commands/ directory, you create reusable command templates tailored to your project. Custom Claude Code commands are particularly powerful for encoding team-specific workflows that everyone on your team can invoke with a single slash.

Built-in Claude Code Commands

Claude Code includes 15 built-in slash commands that cover session management, configuration, authentication, and development workflows. These commands are available in every Claude Code session without any setup. Type /help at any time to see the full list of Claude Code commands available in your current session.

/help

Get help and see available commands

Displays a list of all available Claude Code commands along with brief descriptions. This is the first command new users should run to orient themselves.

/clear

Clear conversation history

Resets the current conversation, removing all previous messages from context. Useful when you want a fresh start without leftover context from earlier tasks.

/compact

Compact conversation to save context

Summarizes the current conversation into a shorter representation, freeing up context window space. Essential for long sessions where you are approaching the token limit.

/cost

Show token usage and cost

Displays a breakdown of tokens consumed in the current session and the estimated cost. Helps you monitor spending and optimize your usage of Claude Code commands.

/doctor

Check Claude Code configuration

Runs diagnostic checks on your Claude Code installation, verifying authentication, configuration files, and environment setup. Run this command first when troubleshooting issues.

/init

Initialize project with CLAUDE.md

Creates a CLAUDE.md file in your project root with recommended structure and settings. This file provides persistent project-level instructions that Claude reads automatically.

/login

Authenticate with Anthropic

Initiates the authentication flow to connect your Claude Code session with your Anthropic account. Required before you can use Claude Code commands that interact with the API.

/logout

Log out of current session

Disconnects your Anthropic account from the current Claude Code session. Use this when switching between accounts or on shared machines.

/mcp

Manage MCP servers

Lists, adds, or removes Model Context Protocol (MCP) server connections. MCP servers extend Claude Code with external tool access such as databases, APIs, and file systems.

/memory

View and manage memory

Shows the contents of your CLAUDE.md memory file and allows you to edit persistent instructions. Memory persists across sessions, making it a powerful complement to Claude Code commands.

/model

Switch between models

Changes the underlying model used by Claude Code. Switch between Haiku for quick tasks, Sonnet for coding, and Opus for deep reasoning — all without leaving your session.

/permissions

Manage tool permissions

Controls which tools Claude Code can use automatically versus which require confirmation. Fine-tune permissions for file editing, command execution, and other operations.

/review

Review code changes

Triggers a code review of your current changes, analyzing diffs for bugs, style issues, and potential improvements. One of the most frequently used Claude Code commands for quality assurance.

/status

Show session status

Displays information about your current Claude Code session including the active model, token usage, connected MCP servers, and installed skills.

/vim

Toggle vim mode

Enables or disables vim-style keybindings in the Claude Code interface. For developers who prefer vim navigation, this command makes the editing experience feel natural.

Custom Slash Commands in Claude Code

One of the most powerful features of Claude Code commands is the ability to create your own custom slash commands. Custom commands let you encode frequently used prompts, workflows, and templates into reusable shortcuts that anyone on your team can invoke.

To create a custom command, add a markdown file to the .claude/commands/ directory. You can place this directory in your project root for project-specific commands, or in your home directory for global commands available across all projects. The filename becomes the command name — for example, deploy.md creates the /deploy command.

The content of your markdown file serves as the prompt template. When someone runs your custom command, Claude Code reads the markdown and uses it as the instruction. You can include a $ARGUMENTS placeholder to accept dynamic input — for example, a custom /review command that takes a file path as an argument.

Custom Claude Code commands are version-controlled alongside your codebase. Commit the .claude/commands/ directory to your repository, and every team member gets the same set of project-specific commands automatically. This makes custom commands an excellent way to standardize workflows across your team.

Example: Creating a Custom Deploy Command

1. Create the command file

# File: .claude/commands/deploy.md


Run the deployment pipeline for this project:


1. Run all tests and ensure they pass

2. Build the production bundle

3. Deploy to the $ARGUMENTS environment

4. Verify the deployment was successful

5. Report the deployment URL

2. Use the custom command

# In Claude Code, type:


/deploy staging


# Claude reads deploy.md and replaces

# $ARGUMENTS with "staging", then

# executes the deployment workflow.

More Custom Command Ideas

/test Run tests for a specific module
/pr Create a pull request with summary
/migrate Generate a database migration
/refactor Refactor a component or module
/doc Generate documentation for a file
/fix Diagnose and fix a reported bug

Claude Code Commands vs Skills

Both Claude Code commands and agent skills enhance your Claude Code experience, but they serve different purposes. Understanding when to use each one helps you build the most efficient workflow.

AspectClaude Code CommandsSkills
PurposeQuick actions execute immediatelyPersistent knowledge loaded automatically
ActivationUser types the slash commandClaude loads when task matches
ScopeSingle action per invocationOngoing guidance across session
FormatMarkdown file in .claude/commands/SKILL.md file in .claude/skills/
Best forDeployments, reviews, one-off tasksCoding standards, patterns, domain knowledge

In practice, the most productive developers use both. Claude Code commands handle explicit actions you trigger on demand, while skills provide background knowledge that shapes every response. For example, you might use a /deploy custom command for deployments, while a "React Best Practices" skill guides every component Claude generates. Explore our full library of skills in the Claude Skills Marketplace.

Tips for Using Claude Code Commands

These tips will help you get the most out of Claude Code commands, whether you are a beginner just learning the basics or an experienced user looking to optimize your workflow.

Start Every Project with /init

Run /init in every new project to create a CLAUDE.md file. This gives Claude persistent context about your project structure, coding standards, and preferences. It is one of the most impactful Claude Code commands for improving response quality.

Use /compact in Long Sessions

When working on complex features, your conversation can grow large. Use /compact to summarize the conversation and free up context window space. This keeps Claude Code responsive and prevents quality degradation that can occur near the context limit.

Switch Models Strategically

Use /model to match the model to your task. Haiku works well for quick edits and straightforward code generation. Sonnet excels at complex coding tasks. Opus is best for deep architectural reasoning. Switching models is one of the most underused Claude Code commands.

Monitor Costs with /cost

Run /cost periodically to track token usage. This is especially important when using Opus for extended sessions. Combining /cost with /compact helps you manage both quality and spending effectively.

Share Custom Commands via Git

Commit your .claude/commands/ directory to version control. This ensures every team member has access to the same custom Claude Code commands. When someone creates a useful command, the whole team benefits through a simple git pull.

Combine Commands with Skills

Use Claude Code commands alongside skills for maximum productivity. Commands handle explicit actions (deploy, test, review) while skills provide background knowledge (coding standards, patterns). Together they create a comprehensive AI development environment.

Claude Code Commands FAQ

What are Claude Code commands?

Claude Code commands are slash commands that you type directly in the Claude Code CLI to perform specific actions. They start with a forward slash (/) followed by the command name. Built-in commands handle tasks like clearing context, switching models, managing permissions, and reviewing code. You can also create custom Claude Code commands by adding markdown files to the .claude/commands/ directory.

How do I see all available Claude Code commands?

Type /help in your Claude Code session to see a complete list of all available commands. This includes both built-in Claude Code commands and any custom commands you have created in your .claude/commands/ directory. The help output shows each command name alongside a brief description of what it does.

Can I create custom Claude Code commands?

Yes. Create a .claude/commands/ directory in your project root or home directory. Add a markdown file for each custom command (for example, deploy.md). The filename becomes the command name, so deploy.md creates the /deploy command. The markdown content serves as the prompt template. Custom Claude Code commands support a $ARGUMENTS placeholder for dynamic input.

What is the difference between Claude Code commands and skills?

Claude Code commands are quick actions triggered by typing a slash command. They execute immediately and are ideal for specific tasks like clearing context or switching models. Skills, on the other hand, are persistent knowledge packages that Claude loads automatically when relevant. Skills provide ongoing guidance across sessions, while commands are one-time actions. Both are valuable — commands for control, skills for knowledge.

Related Resources

Expand your Claude Code knowledge beyond commands. These resources cover skills, the marketplace, and best practices for getting the most out of your AI coding assistant.

Stay Updated with Claude Skills

Subscribe to get the latest Claude Skills, tutorials, and community highlights delivered to your inbox.

We respect your privacy. Unsubscribe at any time.