Claude Code Slash Commands: Built-ins and Custom Commands
Claude Code slash commands explained: the built-in commands worth knowing, how arguments work, and how to make your own custom command with a skill file.
Josh Pocock6 min read
AI Coding
Slash commands
Stride AI Academy
Claude Code slash commands are shortcuts you type at the start of a message, such as /clear, /model or /compact, to control the session instead of asking Claude for something. Type / to see every command available to you, and keep typing to filter the list. You can also add your own commands by writing a skill, which becomes /your-skill-name.
This guide covers how commands work, the built-in ones worth learning first and how to make a custom command, including what happened to the old .claude/commands/ folder. Everything here was checked against Claude Code's commands reference, skills docs and MCP docs on November 18, 2026.
How slash commands work
A command is only recognized at the start of your message. Anything after the command name becomes its arguments, so /compact keep the API decisions passes "keep the API decisions" to /compact.
A few more rules from the docs:
- The menu filters as you type. Type
/then a few letters. Press Enter to run the top match, or use Tab and the arrow keys to pick another. - Commands queue while Claude works. If you send one mid-response, Claude Code runs it after the current turn. Some, like
/status,/tasksand/usage, run right away. - Not everyone sees every command. Availability depends on your platform, plan and setup.
There are four kinds of entries in the / menu: built-in commands coded into the CLI, bundled skills that ship with Claude Code, skills and commands you write yourself, and prompts exposed by MCP servers.
The built-in commands worth knowing
The full list is long. These are the ones that come up in almost every session:
| Command | What it does |
|---|---|
/init |
Creates a starter CLAUDE.md for the project |
/memory |
Edits CLAUDE.md files and manages auto memory |
/clear |
Starts a new conversation with empty context |
/compact [instructions] |
Summarizes the conversation so far to free up context |
/context |
Shows what's filling the context window as a coloured grid |
/model [model] |
Switches model and saves it as your default |
/effort [level] |
Sets how much reasoning Claude applies |
/plan [description] |
Enters plan mode, optionally with a task |
/permissions |
Manages allow, ask and deny rules |
/mcp |
Manages MCP server connections and sign-in |
/resume [session] |
Reopens an earlier conversation |
/rewind |
Rolls code and conversation back to a checkpoint |
/diff |
Shows the changes in your working tree |
/btw [question] |
Asks a side question without adding to the conversation |
/usage |
Shows session cost, plan limits and activity |
/config |
Opens settings such as theme and editor mode |
/help |
Lists help and available commands |
A typical session uses them in roughly this order. Run /init and /permissions when you first open a repo. Use /plan before a large change and plan mode will keep Claude from editing until you approve. When the conversation gets long, check /context and run /compact. Before you ship, /diff shows what changed. When you move to a new task, /clear gives you a fresh start.
If you're setting approval rules for the first time, the Claude Code permissions guide explains what /permissions is editing.
Bundled skills
Some entries in the reference table are marked as skills. They ship with Claude Code but work like skills you write: a prompt handed to Claude. Examples include /code-review, which reviews your current diff, /simplify, which looks for cleanups in changed code, /debug, which turns on debug logging and reads the log, and /loop, which reruns a prompt while the session stays open. The Claude Code loop guide covers that one in depth.
How to make a custom slash command
Custom commands have been merged into skills. The docs put it plainly: your existing .claude/commands/ files keep working, but skills are the recommended format for new work.
Option 1: a skill (recommended)
Make a folder named after your command and put a SKILL.md file inside it:
| Location | Path | Available in |
|---|---|---|
| Personal | ~/.claude/skills/<name>/SKILL.md |
All your projects on this machine |
| Project | .claude/skills/<name>/SKILL.md |
This repository. Commit it to share with your team |
Here's a complete example. Save it as .claude/skills/changelog/SKILL.md:
---
description: Draft a changelog entry from the staged changes
argument-hint: [version]
disable-model-invocation: true
---
Write a changelog entry for version $ARGUMENTS.
## Staged changes
!`git diff --cached --stat`
Group the bullets under Added, Changed and Fixed.Now type /changelog 2.4.0. Claude Code replaces $ARGUMENTS with 2.4.0, runs the git diff line first and puts its output in the prompt, then hands the whole thing to Claude.
What each part does:
- The folder name becomes the command name, unless you set
namein the frontmatter. descriptiontells Claude what the skill is for. It's the one field the docs recommend.argument-hintshows the expected arguments in autocomplete.disable-model-invocation: truemeans only you can run it. Without it, Claude can also load the skill on its own when a request matches.!`command`runs a shell command before the prompt is sent and swaps in the output.
For arguments, $ARGUMENTS holds everything you typed after the command. $0 is the first argument and $1 the second, since the count starts at zero. Quotes group words, so /my-skill "hello world" second sets $0 to hello world.
If you add a skill mid-session and it doesn't show up, run /reload-skills. Skills can also carry scripts and reference files, and there are more frontmatter fields, such as allowed-tools. The guide to creating Claude Code skills covers all of that.
Option 2: a file in .claude/commands/
The older format is a single markdown file. A file at .claude/commands/deploy.md becomes /deploy. It supports the same frontmatter as a skill except name and paths, and the same $ARGUMENTS placeholders.
If a skill and a command file share a name, the skill wins. The docs recommend skills for anything new because they can hold supporting files alongside the instructions.
Commands from plugins and MCP servers
Two other sources add entries to the / menu:
- Plugins. A skill inside a plugin shows up as
/plugin-name:skill-name, so areviewskill inmy-pluginruns as/my-plugin:review. See Claude Code plugins for how to install them. - MCP prompts. An MCP server can expose prompts that appear as
/servername:promptname (MCP). You can also run them as/mcp__servername__promptname, with any arguments separated by spaces, such as/mcp__github__pr_review 456.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
How do I see all Claude Code slash commands?
Type / at the start of a message to open the command menu, then type letters to filter it. Run /help for help and the list of available commands. The full reference lives in Anthropic's commands docs.
How do I create a custom slash command in Claude Code?
Create .claude/skills/<name>/SKILL.md in your project, or ~/.claude/skills/<name>/SKILL.md for every project, with a description in the frontmatter and instructions below it. Type /<name> to run it.
Does .claude/commands still work?
Yes. Custom commands have been merged into skills, but existing .claude/commands/ files keep working, and .claude/commands/deploy.md still becomes /deploy. If a skill has the same name, the skill takes priority.
How do I pass arguments to a custom command?
Type them after the command name. Inside the file, $ARGUMENTS holds all of them, and $0, $1 and so on hold each one in order, starting from zero.
What's the difference between /clear and /compact?
/clear starts a new conversation with empty context. /compact keeps the same conversation but summarizes it to free up space, and you can pass instructions about what the summary should keep.
Can Claude run my custom command by itself?
Yes, by default Claude can load a skill when your request matches its description. Add disable-model-invocation: true to the frontmatter if you only want it to run when you type the command.