Claude Code slash commands: the ones worth knowing
The built‑in Claude Code slash commands worth learning first, how to write your own command, and when a skill is the better choice. Checked in the docs.
What are Claude Code slash commands?
Slash commands are short instructions you type inside a Claude Code session. They change the model, clear context, review code and more. Type / to see the menu, or type / plus a few letters to filter it.
The Claude Code commands page sets one rule to remember: "A command is only recognized at the start of your message". Any text after the command name becomes its arguments.
At the terminal prompt, you can also open one message with several skills. The same page says "Up to six skills can be chained".
Not everyone sees the same menu. The commands page says "Availability depends on your platform, plan, and environment". Its examples: /desktop appears only on macOS and x64 Windows when you sign in with a Claude subscription, and /upgrade does not appear on Enterprise plans.
We checked the Claude Code commands page on 27 November 2026. Check that page before you rely on any row below.
Which built-in slash commands are worth knowing first?
These commands steer a session from day to day. The middle column summarizes the Claude Code commands page in our own words. The last column is our suggestion for when to use each one.
| Command | What it does (commands page) | Use it when |
|---|---|---|
| /clear | Opens a fresh conversation with empty context. /resume brings the old one back. Aliases: /reset, /new. | You move to an unrelated task. |
| /compact | Frees up room by summarizing what has happened so far. You can add focus instructions. | A long task must continue but context is filling up. |
| /context | Draws context usage as a colored grid, with suggestions for what is heavy. | You want to see what is using up the context. |
| /usage | Reports what the session cost, your plan limits and activity stats. /cost and /stats are aliases. | You watch spend or plan limits. |
| /model | Changes the model, and the choice becomes your default for future sessions. In the picker, press s to change it for this session only. | A task needs a different model. |
| /effort | Sets the "effort level: low to xhigh, max, or auto". Max lasts for the session only. | A hard problem needs more effort, or a quick one needs less. |
| /plan | Enters plan mode, optionally with a task, such as /plan fix the auth bug. | Before a change you would hate to undo by hand. |
| /init | Sets up the project with a CLAUDE.md guide. | You start in a new repository. |
| /memory | Opens your CLAUDE.md files for editing and switches auto memory on or off. | You want to change standing instructions. |
| /permissions | Manages allow, ask and deny rules for tools. | You want fewer prompts for safe actions, or to block risky ones. |
| /rewind | Takes the conversation, the code, or both back to an earlier point. Aliases: /checkpoint, /undo. | Claude went the wrong way. |
| /btw | Asks a side question that is not added to the conversation. | A quick question would clutter the main task. |
| /export | Saves the conversation as plain text, to a file or the clipboard. | You need a record of the session. |
Three more cover tools you add. /mcp manages MCP server connections and OAuth, /hooks shows your hook configurations, and /skills lists your skills. Our guide to Claude Code hooks explains what hooks do.
Which commands review code before you merge?
- /code‑review looks for correctness bugs in your current diff, or in a pull request, branch or path you name. Add --fix to have Claude apply the findings, or --comment to "post them on the GitHub PR or GitLab merge request". /review is an alias.
- /
security‑review compares your branch with origin's default branch and flags risks such as injection, auth issues and data exposure. The commands page says it needs an origin remote. - /simplify runs four review agents in parallel to clean up changed code. The commands page is clear: "The review doesn't look for correctness bugs".
So they work as a set. In its /simplify row, the commands page says "Use /code‑review to find bugs". Since /
Which commands are really bundled skills?
The commands page says "Most are built‑in commands whose behavior is coded into the CLI". Rows marked Skill are bundled skills. The page describes those as "a prompt handed to Claude".
In the table we checked, these rows carry the Skill mark:
- /code‑review and /simplify, covered above.
- /doctor checks your setup for installation, settings, extension and CLAUDE.md problems. Claude applies the fixes it proposes after you confirm.
- /loop reruns a prompt again and again during an open session. Give an interval, or leave it out and Claude paces itself. The page's example is /loop 5m check if the deploy finished.
- /batch breaks a large job into 5 to 30 separate units and shows you a plan. Once you approve, it runs one background subagent per unit in its own worktree.
- /debug turns on debug logging for the current session and reads the log to troubleshoot.
Before you run /batch, know that each subagent opens a PR or reports what happened. It also needs a git repository or a WorktreeCreate hook. The commands page pitches it for "large‑scale changes across a codebase".
The commands page adds that "MCP servers can expose prompts that appear as commands", so connected servers may add entries to your menu.
How do you make your own slash command?
Write a skill. The Claude Code skills page says "Custom commands have been merged into skills". The skills page says the frontmatter name field is the "Command name shown in the / menu" and "Defaults to the directory name".
- Create a folder in your project: .claude/skills/changelog/. For a personal folder, ~/
.claude/ skills/ changelog/ , the skills page gives the scope as "All your projects on this machine, but not Cowork or cloud sessions". - Inside it, create a file named SKILL.md. Start it with a short YAML frontmatter block.
- Add a description line. The skills page says "Claude uses this to decide when to apply the skill".
- Add disable-model-invocation: true if only you should start it. The skills page says that with it, "Claude can't invoke the skill on its own". It suggests this for workflows with side effects or timing you want to control.
- Under the frontmatter, write the steps in plain English. Put $ARGUMENTS where the text you type after the command should go.
- Type /changelog followed by your text to run it. /skills shows the skills Claude Code has found.
Worked example. A release notes command could hold these lines in SKILL.md:
- description: Draft release notes from recent commits. Use when asked for a changelog.
- disable-model-invocation: true
- Body: Write release notes for version $ARGUMENTS from the commits since the last tag. Group them under Added, Changed and Fixed. Plain English, no commit hashes.
Typing /changelog 2.4 puts 2.4 where $ARGUMENTS sits. For single arguments by position, the skills page offers $0 for the first and $1 for the second. An optional argument‑hint field shows a hint such as [issue‑number] while you type.
Pick a name nothing else uses. The skills page's name table says that in a local terminal session, a skill named after a built‑in command replaces it, but not its aliases. Its example: "A project usage skill replaces /usage". The same table says "A project code‑review skill replaces /code‑review".
For a fuller walk through of the file, see how to write an agent skill.
Do old .claude/commands files still work?
Yes. The skills page says your existing .claude/
To move one, the page's example takes .claude/commands/deploy.md to .claude/skills/deploy/SKILL.md. You still type /deploy.
If a skill and a commands file share a name, the table on the skills page says the skill is the one that runs.
When is a skill better than a plain command?
The skills page says to "convert a command that needs more than one file to a skill", since a skill folder can hold supporting files. Use this table to pick the setup.
| Your situation | Set it up as | Reason (skills page) |
|---|---|---|
| You start it yourself, at a moment you choose, like a deploy | Skill with disable-model-invocation: true | "Claude can't invoke the skill on its own" |
| You want Claude to use it whenever it fits | Skill with a clear description and default settings | "By default, both you and Claude can invoke any skill" |
| Background knowledge nobody should type | Skill with user‑invocable: false | It is hidden from the / menu. |
| Long reference notes or templates | Skill folder with supporting files | Claude can reach "detailed reference material only when needed". |
| You keep pasting the same checklist | Skill | "Create a skill when you keep pasting the same instructions, checklist, or multi‑step procedure into chat" |
| A short fact every session needs | CLAUDE.md, edited with /memory | A skill fits when a CLAUDE.md section "has grown into a procedure rather than a fact". |
The cost angle: the skills page says "a skill's body loads only when it's used", so long reference material "costs almost nothing until you need it".
For ready‑made ideas, see our list of the best Claude Code skills.
What can a custom command reach, and how do you limit it?
A skill tells Claude what to do with your files and tools. Read any skill before you run it, and keep its reach small.
- allowed‑tools lists "Tools Claude can use without asking permission during the turn that invokes this skill". The skills page adds: "The grant clears when you send your next message".
- The skills page warns that "Claude Code applies a project skill's allowed‑tools" "even in a -p run in a folder you've never trusted". It says "A skill can grant itself broad tool access", so review those fields in a repository first.
- The !`command` syntax runs a shell command before the skill reaches Claude. Setting "disable
Skill Shell Execution": true in settings turns that off for "skills and custom commands from user, project, plugin, or additional‑directory sources". The skills page adds: "Bundled and managed skills are not affected". - /add‑dir gives the session file access to another folder. Add the one project folder you need, never your home folder, Desktop or Downloads.
- /permissions sets allow, ask and deny rules, so you can deny tools a command should never touch. The Claude Code permissions page says "Rules are evaluated in order: deny, then ask, then allow". It adds: "An allow rule can't carve an exception out of a deny rule".
New to the tool? Start with our guide to Claude Code for non developers.
A short routine with these commands
- New repository: run /init, then /memory to adjust the instructions.
- Before a big change: /plan with the task in one line.
- Mid session: /context to see usage, /compact with a focus when it grows, /clear when you switch tasks.
- When it goes wrong: /rewind to an earlier point.
- Before merging: /code‑review, then /
security‑review on changes that touch logins or customer data. - Once a week: /usage for spend, and /skills to prune. In /skills, the t key sorts the list by token count.
Want new skills to turn into your own commands? See today's agent skills in the feed. Scroll AI Now is a free learning feed, and it does not run your agents for you.
Questions
Are custom slash commands deprecated in Claude Code?
Not removed. The skills page says custom commands "have been merged into skills" and existing .claude/
Why can't I see a command that a guide mentions?
The commands page says "Availability depends on your platform, plan, and environment". For example, /upgrade does not appear on Enterprise plans.
What is the difference between /clear and /compact?
/clear starts a new conversation with empty context, and /resume can bring the old one back. /compact keeps the same conversation but summarizes it to free up room.
Can Claude run my custom command without me typing it?
Yes, by default. The skills page says "By default, both you and Claude can invoke any skill". Set disable-model-invocation: true to keep it manual.
How many skills can I use in one message?
At the terminal prompt, the commands page says "Up to six skills can be chained" at the start of one message. The text after them goes to each as arguments.