Claude Code Slash Commands: Built-in vs Custom
How Claude Code distinguishes fixed built-ins, bundled skills, legacy custom commands and current skills, plus a safe command-to-skill migration check.
Updated · Markdown version
Claude Code exposes fixed built-in commands, bundled prompt-based skills, and user-authored skills. Legacy Markdown files under .claude/commands/ still work, but current documentation says custom commands have been merged into skills and recommends a skill directory for new work, especially when supporting files are needed.
Built-in commands
Most built-in commands execute fixed Claude Code logic; /help and /compact are examples named in the current skills documentation. Bundled skills are different: the documentation lists examples such as /doctor, /code-review, /batch, /debug, /loop, and /claude-api, and describes them as prompt-based workflows that Claude orchestrates with tools. Consult the current commands reference for the exact commands and settings available in your installed version.
Where custom commands live
The current documentation describes .claude/commands/ as the older Markdown command format. Its migration example maps .claude/commands/deploy.md to .claude/skills/deploy/SKILL.md, preserving /deploy.
For an existing legacy command:
- Put its instructions in a Markdown file under the appropriate
.claude/commands/location used by your setup. - Add a
descriptionwhen you want Claude to match it automatically. Adddisable-model-invocation: truewhen it must be manual-only. - Open the slash menu and confirm the expected command is present before relying on it. Then invoke it on a harmless example and check that it follows the file's instructions.
The supplied source excerpt does not establish the nested-folder colon mapping or every personal/project command location previously stated here. Obtain the relevant official documentation region before restoring those details.
Built-in versus custom: a comparison
| Feature | Built-in command | Custom command |
|---|---|---|
| Defined by | Claude Code itself | A Markdown file you write |
| Editable | No | Yes |
| Command name comes from | Fixed name | Legacy file placement; verify the displayed name in the slash menu |
| Storage | Built into Claude Code | Legacy .claude/commands/ locations used by the current setup |
Choose a custom command when one prompt you repeat needs the same instructions each time and fits in a single file. Choose a skill directory when the instructions also need a script, a reference document or an example that should load only when relevant. Both are invoked with a slash, so the name you type does not show which format you picked.
Converting a command into a skill
Moving .claude/commands/deploy.md to .claude/skills/deploy/SKILL.md keeps the /deploy name. The skill directory can then hold supporting files next to SKILL.md. Command files still work, so you can move them one at a time. During a partial migration, keep track of both copies and use /skills, /context, or the slash menu to confirm which source is active. The supplied documentation excerpt does not establish the precedence rule previously stated here.
Pitfalls
- The expected command is absent. Open the slash menu and check whether the file is saved in a supported skill or command directory. Separately, if automatic matching fails, check YAML frontmatter: the documented malformed-YAML behavior leaves the skill body loadable and direct
/skill-nameinvocation available, but loses metadata used for description-based matching. - A migration leaves two copies. Check both
.claude/commands/and.claude/skills/, then use/skills,/context, or the slash menu to identify the active source before deleting either copy. - The command appears but behaves differently than expected. Test it on a harmless input. Menu presence proves discovery, not that the instructions are correct or that required tools are available.
- Side-effect commands run on their own. Without
disable-model-invocation: true, Claude may invoke a command when it judges the command relevant. Add the flag to anything that deploys, sends or deletes. - Misspelled frontmatter keys are silently ignored. A typo in
disable-model-invocationleaves the setting off with no warning. Re-read the frontmatter after each edit.
When to use a skill instead
A command file suits a short prompt you type by hand, such as a review checklist. Once the same instructions need reference material, or the prompt grows past a screen, a skill directory is easier to maintain. Two related skills on this site address the surrounding work. rules-to-skills-migration moves long runbooks and rule files out of always-loaded context and into on-demand skills, which is useful when a command grew out of a runbook. agent-instruction-files audits the memory files Claude loads at the start of every session, so a command's instructions are not duplicated there. Neither skill replaces the command layout itself, and a small project with two commands may not need either.
FAQ
Are Claude Code skills and slash commands the same thing?
Custom commands have been merged into the skills system, but the file formats still differ. A legacy command is a Markdown file under .claude/commands/; a skill is a directory containing SKILL.md and may include supporting files. A skill or legacy command can be model-invoked unless its frontmatter disables that behavior.
Do my existing `.claude/commands/` files still work?
Yes. Existing command files keep working and Claude can still invoke them. Migrating is optional, and the documentation recommends skills for new work.
How do I keep Claude from running a custom command on its own?
Add disable-model-invocation: true to the command's frontmatter. The command then runs only when you type its name.
Related skills in this catalog
Platform Score is our assessment under a published method. It is not a safety guarantee.
Related guides
- Caveman skill for Claude Code: what it does, how to install it and what it saves
- The grill-me skill: what it does, how to install it and how the interview works
- Cursor vs Claude Code: Editor or Terminal Workflow
- What Is Claude Code and What It Can Touch on Your Machine
- Agentic Coding Tools: What They Are and How to Choose One
- Codex vs Claude Code: Config Files and Sandbox
Terms this guide uses
This item is a worked example in the AI glossary for:
Sources
- https://code.claude.com/docs/en/skills (accessed 2026-11-25)