Slash command
A slash command is a short instruction that starts with “/” and goes at the beginning of a message in Claude Code, such as /clear, /compact or /model. Built-in commands control the session: they clear the conversation, switch the model or open settings. You can add your own as skills or as files in .claude/commands/. Anthropic's newer documentation simply calls them “commands”.
A command that starts with “/”, typed in the conversation with Claude, for example /clear or /init.
How it shows up in Claude Code
Type / and the list of available commands appears; keep typing a few letters to filter it. A command is only recognised at the start of your message, and any text after it becomes its arguments. A few you'll use often:
- /clear starts a new conversation with an empty working memory;
- /compact summarises the conversation to free up room;
- /init writes a first CLAUDE.md for the project;
/modelswitches the model,/helpshows help, and/rewindtakes you back to an earlier point.
Your own commands are now made as skills: a file at .claude/skills/deploy/SKILL.md creates the /deploy command.
Example
You've finished one feature and are moving on to the next:
/compact keep the decisions about the contact form
Claude summarises the conversation, keeps what you asked for, and you have room again for the next task. If the new task has nothing to do with the old one, /clear is the better choice.
Common mistakes
- Typing the command in the middle of a message. It has to be the first thing you write.
- Mixing up
/clearand/compact: the first starts from zero, the second keeps a summary. - Confusing commands in the conversation with terminal commands such as
claude mcp add, which you type before starting Claude.
Related terms and where you learn it
Commands work closely with the context and the session. You learn the main ones in the lesson “What are the main slash commands?” in the free module 00 · Installation and first steps, and your own in module 05 · Skills: reusable recipes.
Source: Claude Code docs: Commands
How it appears in the course
In the desktop app: type / in the message box or click the + button → Slash commands. You see a list with your skills, the project’s skills and the built-in commands.
What is a skill? · Module 05, Skills: reusable recipes
They’re called slash commands (the commands that start with /). You type them inside Claude, not in the regular terminal.
What are the main slash commands? · Module 00, Installation and first steps · free
In the terminal, you open it by hand with a slash command. Now you do it.
How do you get started quickly? · Module 02, CLAUDE.md: your project’s memory
Learn Claude Code from zero, in plain English
12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.