In Claude Code, both Skills and Slash Commands allow you to extend the AI's capabilities, but they serve distinct purposes. It can be confusing to know when to use one over the other. This lesson clarifies the fundamental difference between them and demonstrates the ideal use case for each.
You'll learn that Slash Commands are for tasks you want to invoke manually and directly from the command line—acting as convenient shortcuts. In contrast, Skills are tools you provide for the AI agent to discover and use dynamically as part of a larger, more complex plan.
Workflow demonstrated in this lesson:
- Creating a Slash Command: Generate a
/compressslash command directly from an existingcompressskill. - Manual Invocation: Run the
/compresscommand to see how it provides a direct, user-driven way to perform a specific action. - Agent-Driven Workflow: Delete the slash command and provide a multi-step plan (find files, sort them, then compress).
- Dynamic Skill Use: Watch as the AI agent autonomously discovers and invokes the
compressskill at the appropriate step in its plan, without any direct command from the user.
Key benefits:
- Clarify Your Workflow: Understand the clear distinction between user-invoked commands and agent-driven tools.
- Build for the Right Context: Create Slash Commands for quick, repetitive manual tasks.
- Empower the Agent: Design Skills as building blocks the AI can use to solve complex, multi-step problems on its own.
- Improve Automation: Choose the right tool for the job to create more efficient and powerful AI-assisted workflows.
Summary
This lesson clarifies the difference between Claude Code's Slash Commands and Skills. Slash Commands are designed for direct, manual invocation by the user, serving as shortcuts for repetitive tasks. Skills, on the other hand, are tools provided to the AI agent, which it can discover and use dynamically as part of a larger, multi-step plan. The video demonstrates this by first creating a /compress slash command from an existing compress skill and running it manually. Then, the slash command is removed, and the AI is given a complex task to find, sort, and compress files. In this scenario, the AI autonomously invokes the compress skill at the correct moment, showcasing how skills empower the agent to solve problems without direct user intervention for each step.
Prompts
Terminal Commands
Code Snippets
The following is the compress.md file generated for the /compress Slash Command. Note its structure is nearly identical to a SKILL.md file, defining allowed tools, arguments, and instructions for execution.
