Built-in vs. Custom Slash Commands
CoreIdentify Claude Code's core component types · Difficulty 1/5
Explanation
Built-in Slash Commands
Claude Code ships with built-in Slash Commands for common actions -- for example:
/clear-- resets the conversation context to keep it focused/init-- bootstraps a starter `CLAUDE.md` by analyzing the existing codebase/help-- lists available commands
Custom Slash Commands
Beyond the built-ins, a developer can author custom Slash Commands as Markdown prompt files placed in .claude/commands/. Each file defines a repeated workflow (a prompt template) that can be invoked by name, turning a frequently-typed multi-line instruction into a single /command-name call.
Custom commands are one of the concrete mechanisms Anthropic's best-practice guidance points to for tightening a workflow "with custom commands and hooks rather than long, brittle prompts" -- i.e., encode a repeated procedure once as a command instead of re-typing or re-explaining it every session.
Common exam traps
- Assuming all Slash Commands are built-in. Custom commands authored as
.claude/commands/*.mdfiles are just as much "Slash Commands" as/clearor/init. - Confusing
/init(bootstraps `CLAUDE.mdfrom the codebase) with/clear` (resets context) -- both are built-ins but do unrelated things.
Key Takeaways
- Built-in slash commands include /clear (reset context), /init (bootstrap CLAUDE.md), and /help
- Custom slash commands are Markdown prompt files authored in .claude/commands/
- Custom commands encode a repeated workflow once, invoked later by name, instead of re-typing a long prompt
- Custom commands are just as much slash commands as the built-ins -- the distinction is authorship, not command syntax
Glossary Terms
A markdown configuration file read by Claude Code at startup that injects persistent context, project conventions, and tool guidance into every session — without re-prompting. Claude Code supports CLAUDE.md files at the global, project-root, and subdirectory levels (see /glossary/path-specific-rules for the hierarchy). Uses @import for modular organization.
Named, explicitly invoked instructions in Claude Code -- built-in (e.g., /clear, /init, /help) or custom commands authored as Markdown prompt files in .claude/commands/. Distinguished from Skills by invocation: a Command is called by name; a Skill loads automatically when Claude judges it relevant.
Related Concepts