Video summary

Claude Code Tutorial #6 - Slash Commands

Main summary

Key takeaways

Technology

Summary

This lesson explains Claude Code’s built-in slash commands and demonstrates how to create reusable custom commands for common development tasks.

Built-in commands

Typing / opens the command list. Examples covered include:

  • /clear and /compact for managing conversation context.
  • /add-dir for adding another working directory, which is useful when working across related repositories.
  • /agents for managing subagents.
  • /model for choosing a model.
  • A permissions command for adding tool permissions to the project’s local settings.

Creating custom commands

Custom commands package detailed, reusable prompts. The instructor creates a command file in a commands folder inside the project’s .claude directory. Its instructions specify where files should go, naming conventions, component variants and sizes, tests, and a preview-page entry. An @ reference can include another file as context.

A custom command is effectively a Markdown prompt that Claude Code loads when the command runs. In the demonstration, the first version generates a card component, its tests, and a preview. The tests pass, and the component is checked in the browser, including in dark mode.

Adding arguments

The tutorial then adds command arguments so users can specify which component to create. Front matter provides a description and an argument hint for the interface. The command uses $ARGUMENTS; the instructor demonstrates square-bracket notation to have Claude interpret two values—a component name and summary—separated by a pipe.

After changing a command file, the instructor restarts Claude Code so the updated command appears. A second run creates an icon component from the supplied arguments.

Reviewing generated code

The instructor emphasizes reviewing generated code rather than accepting it automatically. For example, the initial icon uses emojis. After the instructor requests an icon library instead, Claude Code updates the component and preview.

Guide/tutorial covered: Creating a Claude Code custom slash command, adding context and arguments, generating and testing UI components, and reviewing the results.

Main speaker/source: The Net Ninja instructor/narrator.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video