PrepGenAICerts

Built-in vs. Custom Slash Commands

Core

Identify Claude Code's core component types · Difficulty 1/5

0%
slash-commandsclaude-codecustom-commandsinit

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/*.md files are just as much "Slash Commands" as /clear or /init.
  • Confusing /init (bootstraps `CLAUDE.md from 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

Related Concepts

PrepGenAICerts is an independent exam-prep site. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. Claude and Anthropic are trademarks of Anthropic, PBC. Exam details are taken from publicly available Anthropic and Pearson documentation. About PrepGenAICerts.