# Claude Code slash commands: the built-in ones and how to write your own

> Claude Code slash commands are shortcuts you type at the start of a message, such as /help, /clear and /plan. Type / to see the ones you have. To add your own, create a skill, which is a folder with a SKILL.md file, and its name becomes the command. In Anthropic's docs a custom command is now a skill, and old `.claude/commands/` files still work.

Mindket editors · Published 2026-11-04 · Updated 2026-11-05 · https://mindket.com/learn/claude-code/claude-code-slash-commands

## In short

- Type `/` to list the commands you have, or `/` plus letters to filter. A command counts only at the start of your message, and the text after it becomes its arguments.
- Custom commands are skills now: `.claude/commands/deploy.md` and `.claude/skills/deploy/SKILL.md` each give you `/deploy`.
- `$ARGUMENTS` in the skill text stands for your input after the command.
- `disable-model-invocation: true` stops Claude from running a command on its own, which suits anything with side effects.

## Before you start

You need Claude Code from [lesson 1](https://mindket.com/learn/claude-code/install-claude-code) and a project that uses git, because the sample command reads your uncommitted changes. Slash commands run inside a session. The shell commands from lesson 1, such as `claude -p`, run from the terminal instead.

## Write your first custom command

[Anthropic's skills page](https://code.claude.com/docs/en/skills) builds its first example in three moves, and this lesson follows it. The skill below summarizes your uncommitted changes. The line that starts with an exclamation mark runs `git diff HEAD`, and Claude Code puts the output into the skill before Claude reads it.

````markdown
---
description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks to review their diff.
---

## Current changes

!`git diff HEAD`

## Instructions

Summarize the changes above in two or three bullet points, then list any risks you notice such as missing error handling, hardcoded values, or tests that need updating. If the diff is empty, say there are no uncommitted changes.
````

1. Make a folder for the command in your personal skills folder: `mkdir -p ~/.claude/skills/summarize-changes`. Personal skills work in all your projects. On Windows, create the same folder inside your user folder.
2. Save the text above as `SKILL.md` in that folder. The folder name becomes the command, so this one is `/summarize-changes`.
3. Open a git project, change one file and run `claude`.
4. Run the command directly with `/summarize-changes`. You can also ask "What did I change?" and let Claude load the skill because the description matches.
5. Edit the description or the instructions and run the command again. Claude Code picks up the change in the same session.

## The built-in commands to learn first

[The commands reference](https://code.claude.com/docs/en/commands) groups its commands by when you reach for them. In a new repository you run `/init` for a starter CLAUDE.md, then `/memory` to refine it. During a task, `/plan` and `/model` change how Claude works. When the conversation gets long, `/context` and `/compact` deal with the space.

Some entries in that list are bundled skills, such as `/doctor` and `/code-review`. They are prompts handed to Claude, and you run them the same way as the commands that execute fixed logic. Which commands you see depends on your platform, plan and environment.

| Command | What it does |
| --- | --- |
| `/help` | Shows help and the available commands |
| `/init` | Initializes the project with a CLAUDE.md guide |
| `/plan [description]` | Enters plan mode, and starts on the task if you add a description |
| `/model [model]` | Switches the model and saves it as your default for new sessions |
| `/context` | Shows context usage as a colored grid |
| `/compact [instructions]` | Summarizes the conversation so far to free up context |
| `/clear [name]` | Starts a new conversation with empty context |
| `/resume [session]` | Resumes a conversation by ID or name, or opens the session picker |
| `/rewind` | Rewinds the conversation, the code or both to a previous point |
| `/diff` | Shows the changes in your working tree, including Claude's edits so far |

## Custom commands are skills now

The older way to make a command was a Markdown file in `.claude/commands/`. Anthropic's skills page now says custom commands have been merged into skills: a file at `.claude/commands/deploy.md` and a skill at `.claude/skills/deploy/SKILL.md` both create `/deploy` and work the same way. Existing command files keep working, and the docs prefer a skill for new work because skills also take supporting files.

If both exist under one name, the skill wins. A command file accepts the same frontmatter as a skill, except `name` and `paths`.

Where you save the file decides who gets the command. The Mindket guide to [creating an Agent Skill](https://mindket.com/blog/how-to-create-agent-skill) goes deeper on the file itself.

**Commands and skills in the Claude Code changelog**

1. **January 7, 2026** The /plan command arrives. Version 2.1.0 adds a shortcut into plan mode from the prompt.
2. **January 9, 2026** Commands merge into skills. Version 2.1.3 merges slash commands and skills, with no change in how either behaves.
3. **February 28, 2026** /simplify and /batch ship. Version 2.1.63 adds both as bundled commands.
4. **May 27, 2026** /reload-skills arrives. Version 2.1.152 re-scans the skill folders without a restart.
5. **October 19, 2026** Skills come back after compaction. Version 2.1.304 sends Claude the skill list again once a conversation is compacted.
6. **November 4, 2026** Custom commands speak up in scripts. Version 2.1.318 fixes custom commands that printed nothing in `claude -p` and SDK sessions when they failed.

Source: [Claude Code changelog](https://code.claude.com/docs/en/changelog) (read 2026-11-05)

| Where | Path | You type |
| --- | --- | --- |
| Personal, all your projects | `~/.claude/skills/deploy/SKILL.md` | `/deploy` |
| One project, shared by committing it | `.claude/skills/deploy/SKILL.md` | `/deploy` |
| Older command file | `.claude/commands/deploy.md` | `/deploy` |
| Command file in a subfolder | `.claude/commands/frontend/component.md` | `/frontend:component` |
| Inside a plugin | `my-plugin/skills/review/SKILL.md` | `/my-plugin:review` |

## Arguments, and who can run a command

Whatever you type after the command name replaces `$ARGUMENTS`. Run `/fix-issue 123` against the skill below and Claude receives "Fix GitHub issue 123 following our coding standards" and the numbered steps. For several values, `$ARGUMENTS[0]` and `$ARGUMENTS[1]`, or the shorter `$0` and `$1`, pick them by position.

If the text has no placeholder, Claude Code adds a final line that starts with `ARGUMENTS:` and holds your input, so Claude still sees what you typed. A frontmatter `argument-hint` such as `[issue-number]` shows the expected input while you type.

Anthropic's own example of a command to keep away from Claude is `/deploy`. You do not want Claude deciding to deploy because the code looks ready. `disable-model-invocation: true` handles that, and `user-invocable: false` does the reverse.

````markdown
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS following our coding standards.

1. Read the issue description
2. Understand the requirements
3. Implement the fix
4. Write tests
5. Create a commit
````

| Frontmatter | You can run it | Claude can run it |
| --- | --- | --- |
| Nothing set | Yes | Yes |
| `disable-model-invocation: true` | Yes | Not on its own |
| `user-invocable: false` | No | Yes |

## How Claude Code's creator turns daily work into commands

Boris Cherny created Claude Code at Anthropic. In January 2026 he [wrote on X](https://x.com/bcherny/status/2007179847949500714) that he makes a slash command for every "inner loop" task he repeats many times a day. It saves him retyping prompts, and Claude can run the same workflow. His `/commit-push-pr` command runs dozens of times a day. It uses inline bash to collect `git status` before the model reads the prompt, which is the exclamation-mark line from your first command above. He kept his commands in `.claude/commands/`, checked into git, and a skill folder does the same job today.

In February 2026 he [announced two bundled skills](https://x.com/bcherny/status/2027534984534544489), `/simplify` and `/batch`, after using both daily. Today `/simplify` reviews the code you changed for cleanup and applies the fixes. `/batch` plans a large change, splits it into 5 to 30 independent units and hands each to a background subagent once you approve. Run `/simplify` after your next edit to see a bundled skill work like any other command.

> I use slash commands for every "inner loop" workflow that I end up doing many times a day.
>
> Boris Cherny, Creator of Claude Code, Anthropic, [X](https://x.com/bcherny/status/2007179847949500714) (read 2026-11-05)

[![Boris Cherny (@bcherny) on X, 2 January 2026, tip 7 of his setup thread. I use slash commands for every inner loop workflow that I end up doing many times a day. Commands are checked into git and live in .claude/commands/.](https://mindket.com/blog/shots/x-bcherny-inner-loop-commands.webp?v=e6d4903bbcfa)](https://x.com/bcherny/status/2007179847949500714)

Boris Cherny on X, 2 January 2026

[![Boris Cherny (@bcherny) on X, 28 February 2026. In the next version of Claude Code, we're introducing two new Skills: /simplify and /batch. I have been using both daily.](https://mindket.com/blog/shots/x-bcherny-simplify-batch.webp?v=d164c25f2544)](https://x.com/bcherny/status/2027534984534544489)

Boris Cherny on X, 28 February 2026

> Screenshots of X's own embeds of the posts, taken on 5 November 2026, with the time in UTC. X cuts both posts short with Show more. Select a screenshot to open the post on X.

## Common mistakes

- Typing the command after other words. Claude Code recognizes a command only when it opens the message. After plain text, the name only gives Claude permission to run a skill, and nothing runs directly.
- Hitting Enter after a typo. Nothing is highlighted, `Enter` submits your text as typed and Claude Code reports "Unknown command". Pick a close match with `Tab` or the arrow keys. A command your platform or plan lacks is missing from the menu too.
- Misspelling a frontmatter field. A field name must match the docs exactly, hyphens included, and Claude Code ignores one it does not recognize without an error. The opening `---` must also be the first line of the file.
- Naming a command after a built-in one. In a local terminal session, your skill replaces the built-in command of that name, though not its aliases.
- Writing new commands in `.claude/commands/` because an older tutorial does. It still works. A skill does more, and a skill with the same name beats the command file.

## Try it yourself

- Type `/` in a session and scroll the list. Filter it with a few letters, then run `/help`.
- Create `/summarize-changes` as above and run it twice: once with `/summarize-changes` and once by asking "What did I change?".
- Save the `fix-issue` text as a second skill and run `/fix-issue 123`. Then remove `disable-model-invocation: true`, which puts the description in Claude's context so Claude can load the skill itself.
- Make a command of your own for something you paste into chat every week, using the same two-part file: frontmatter, then instructions.

## Next: hooks

A command runs when you ask. [Lesson 4](https://mindket.com/learn/claude-code/claude-code-hooks) covers hooks, which run on their own at fixed points, such as right before a tool call.

To share a command with other people, package it in a plugin, which our [Claude Code plugins post](https://mindket.com/blog/claude-code-plugins) covers.

## Check yourself

1. You save a skill at `~/.claude/skills/summarize-changes/SKILL.md`. Which command runs it?

   A. `/summarize-changes`
   B. `/skills summarize-changes`
   C. `/personal:summarize-changes`
   D. `/run SKILL.md`

   Answer: A. The folder name becomes the command, and a personal skill works in all your projects.

2. You run `/fix-issue 123` against a skill that contains `$ARGUMENTS`. What does `$ARGUMENTS` stand for?

   A. The command name `fix-issue`
   B. The path to the SKILL.md file
   C. The text `123` after the command name

   Answer: C. Whatever you type after the command name replaces `$ARGUMENTS`.

3. Which frontmatter line stops Claude from running a command such as `/deploy` on its own?

   A. `user-invocable: false`
   B. `argument-hint: [manual]`
   C. `disable-model-invocation: false`
   D. `disable-model-invocation: true`

   Answer: D. `disable-model-invocation: true` keeps Claude from starting the command itself, while `user-invocable: false` does the reverse.

4. Which message runs `/summarize-changes` directly?

   A. `please run /summarize-changes`
   B. `/summarize-changes`
   C. `run it with /summarize-changes now`

   Answer: B. Claude Code recognizes a command only when it opens the message, and after plain text nothing runs directly.

## Frequently asked questions

### Can a command pre-approve tools so Claude stops asking?

Yes, with `allowed-tools` in the frontmatter. The docs show a `/commit` skill that lists `Bash(git add *) Bash(git commit *) Bash(git status *)` there. The grant covers only the turn that runs the command and clears when you send your next message, and your permission settings still govern anything not listed. Review that field in any skill checked into a repository before you run Claude Code there, because a skill can grant itself broad access.

### What is the difference between a slash command and a skill?

In Claude Code there is almost none now. Both create a `/name` command. A skill adds a folder for supporting files, frontmatter that controls who can run it, and automatic loading when its description fits what you ask.

### Do I need to restart Claude Code after adding a command?

No. Claude Code watches `~/.claude/skills/` and the project's `.claude/skills/` and picks up an added, edited or removed skill in the same session. The exception is a top-level skills folder that did not exist when the session started. Run `/reload-skills` after creating it.

### How do I hide a command from the / menu?

Set `user-invocable: false` in its frontmatter. Claude Code then hides it from the menu and does not run it when you type its name, while Claude can still load it. Use that for background knowledge that is not an action you would take.

### Can a plugin add slash commands?

Yes. A plugin's skills appear as `/plugin-name:skill-name`, so they never clash with your own commands. Our [plugins post](https://mindket.com/blog/claude-code-plugins) covers building and installing one.

### Can /init set up more than a CLAUDE.md?

With `CLAUDE_CODE_NEW_INIT=1` set, it runs an interactive flow that also walks through skills, hooks and personal memory files. If it finds OpenAI Codex or Google Gemini CLI configuration, it offers to carry it over with `/import`.

### Can I run two commands in one message?

At the terminal prompt, yes. Typing `/write-tests /fix-issue 123` loads both skills and passes the trailing text to each as arguments. Claude Code expands the first skill plus up to five more stacked after it.

## Sources

- [Claude Code docs: Commands](https://code.claude.com/docs/en/commands) (read 2026-11-04)
- [Claude Code docs: Extend Claude with skills](https://code.claude.com/docs/en/skills) (read 2026-11-04)
- [Claude Code changelog](https://code.claude.com/docs/en/changelog) (read 2026-11-05)
- [Boris Cherny on X: tip 7, slash commands, 2 January 2026](https://x.com/bcherny/status/2007179847949500714) (read 2026-11-05)
- [Boris Cherny on X: /simplify and /batch, 28 February 2026](https://x.com/bcherny/status/2027534984534544489) (read 2026-11-05)

[Start lesson 4](https://mindket.com/learn/claude-code/claude-code-hooks)
