- Genial
- Tutorial su IA e automazione
- Claude Code Skills vs Commands: The Key Difference
Claude Code Skills vs Commands: The Key Difference
Custom slash commands and skills look almost identical in Claude Code: both are markdown files sitting on your computer. The difference between them is subtle but key, and once you see it, you will understand why Anthropic is pushing everything toward skills. In this walkthrough I build a real use case, wrap it in a custom slash command, convert that command into a skill, and show you side by side why skills win.
What you need
- Claude Code installed and running
- Any repeatable use case you run more than once; I use fake data generation with the Faker library
1. Live demo: generating 10,000 fake entries (0:32)
The best way to show this is through an example, as usual. I ask Claude Code:
Hey, Claude. Can you please generate ten thousand fake entries of just
random fake people using the Faker library for me, please? Thank you.
Faker is a library for generating mock data whenever you need to run data analysis tests, and it is super useful. Claude Code confirms the plan and gets to work in the background while I explain the concepts.
2. What are custom slash commands? (1:01)
A custom slash command is pretty much just a mega prompt. Since 2022, most of us have maintained prompt libraries somewhere and copied and pasted from them all day, which gets annoying and is not very ergonomic. Anthropic's answer was custom slash commands: a library of prompts that lives inside your computer. Whenever you work with Claude Code, you have this whole library available for any use case you have prepared.
3. Creating the command (2:04)
My fake data run finished, and let's say I will be doing this ten, twenty, fifty times a day. I do not want to re-explain it every time, so:
Hey, Claude. Can you please create a custom slash command for this use
case? Make sure it's a command and not a skill, though. Thanks.
Claude looks at everything he just did and generates the mega prompt that reproduces that exact output on demand. Commands are stored in the .claude folder, under commands, as markdown files. Markdown is simply a text format, so your library is really just text files with all the necessary instructions.
One annoying detail: after creating a command you have to restart your Claude instance before it appears. Once restarted, I type the beginning of the name and there it is:
/generate-fake-people
Run it and Claude Code does exactly what he did before. Instead of talking for thirty seconds or typing for five minutes, I get the same output with a tenth of the work.
4. Turning the command into a skill (4:23)
Now let's push further:
Hey, Claude, can you now turn this custom slash command into a whole
skill, please? Thank you.
And yes, I always say thank you to Claude. Skills are also markdown files on your computer, living in their own skills folder, but with two upgrades. First, a skill can be associated with code. A slash command is only a markdown file, so Claude sometimes gets confused and regenerates the script from scratch. A skill saves the code it uses and reuses that exact same code every single time. Second, and most importantly, skills can be shared within an organization and called via API, so everyone produces the exact same result at scale. That is the best use case for skills: sharing them with friends or coworkers.
5. Skills are auto-invocable (6:20)
Another key difference: skills can be invoked without naming them. With a command you must explicitly type the slash. With a skill called generate fake people, I only need to say something vague like "I'm going to need help generating some fake people information," even in the middle of a bigger task, and Claude will pull in the right skill on his own.
6. The context window, on the whiteboard (6:57)
How does Claude always know which skills he has? Picture the context window: the memory your LLM has during a conversation. Inside it there is the system prompt, which shapes how the AI behaves, and then your queries. Custom slash commands live nowhere in there by default. When you type one, the command gets replaced by the huge prompt from the markdown file, dumping a lot of text into the window at once.
Skills work differently. Every skill has a short description at the top of its file, and that small list of descriptions is always available to Claude Code, sitting near the top of his brain. When you ask for something related, he remembers he has that capacity and pulls the full skill in only when needed. This saves a lot of context window space: instead of the entire file living in memory, only a small entry does, which is more than enough for Claude to know when to use it.
7. Skills vs commands, side by side (10:43)
Here is the scoreboard from my whiteboard:
Skills: always known to Claude | invocable with vague phrasing | shareable via API
Custom commands: must be typed with / | cannot fire by accident | file shareable, no API
There is a real benefit on the command side: they cannot be invoked by accident, because you always type the slash and the name. Sometimes you want that. But skills carry the ecosystem advantages.
8. Anthropic is migrating to skills only (11:56)
Anthropic is currently migrating everything related to custom slash commands into skills. They are a great company, but more often than not they ship several features that do the exact same thing, which can be a bit annoying. Custom slash commands were the first version of skills. Going forward, stick to skills: it is the mode they will be working with. One more reason: agents, which I will cover next, cannot use custom slash commands, but they can use skills.
Pitfalls and tips
- After creating a custom slash command, restart your Claude instance or it will not show up in the slash menu.
- If Claude keeps regenerating scripts for a repeated task, that is your signal to convert the command into a skill so the code is saved and reused.
- Watch out for accidental invocation: vague phrasing can trigger a skill you did not intend. Commands are safer when you need explicit control.
- Write clear skill descriptions. That short description is all Claude sees until he loads the skill.
Where to go next
If you are still setting up the basics, start with Claude Code for Beginners (2026 Guide). To see how the three Claude products fit together, watch Claude vs Cowork vs Claude Code Explained (2026).


