◆ Vibe EngineeringSMIT · AI Agentic Engineering Urdu
Class 12 · 12.3

Custom slash commands: your own shortcuts

Our first pro feature is the simplest and most immediately useful: making your own slash commands. If you type the same instruction again and again, wrap it in a command — and share it with your whole team through Git.

🎯 Goal: make a reusable command⏱ Read: 12 min⌨️ Type: hands-on

You have used built-in slash commands all course — /context, /init, /agents. Now you make your own. It is, as ever, gloriously simple: it all comes back to the .claude folder.

01What a slash command is

A slash command is just a saved prompt with a name. Type /, pick it from the list, and Claude Code runs the instruction inside — optionally with whatever you type after it. Two ways to create one, and we’ll meet both.

02Make one: the commands folder

Inside .claude (in your project, or in your home directory to apply everywhere), make a folder called commands. Every markdown file you drop in becomes a slash command — the filename is the command name. Convention: lowercase with hyphens.

Create the folderonce

.claude/commands/ — that’s the whole setup.

Add a markdown fileper command

doc-review.md becomes the /doc-review command. Its contents are the prompt.

Save — doneinstant

Just by saving the file, the command exists. No restart config needed.

03The $ARGUMENTS trick

To make a command flexible, drop $ARGUMENTS (block caps) into the prompt. Whatever the user types after the command name gets slotted in there.

.claude/commands/doc-review.md
Review the documentation file in the planning folder called
$ARGUMENTS and add questions, clarifications, or feedback to a
new section at the end — along with any opportunities to simplify.
“Opportunities to simplify” — bake in good habits

Notice the command always asks for simplification opportunities. Encoding a good habit into a command means you get it every single time, for free. Little touches like this are why custom commands pay off.

04Try it: /doc-review plan.md

Launch Claude, type /, and there it is. Pass an argument and watch it run:

claude
> /doc-review plan.md

# Claude reads plan.md, finds it’s empty scaffolding,
# and appends a “Document review” section with:
• Questions & clarifications  (orphan headings, naming mismatches…)
• Simplification opportunities (drop the massive API? snapshot every 30s?)
You are still the manager

The command surfaced great questions and some simplifications the instructor disagreed with (drop the market-data API, drop per-user IDs). Accept the good, reject the rest. The tool asks; you decide — that’s where you add value.

05The second way: skills give you a command for free

Here is the neat part. Every skill automatically shows up as a slash command too. Because you have a cerebras-inference skill, /cerebras-inference is already in your list — no commands folder needed.

.claude/commands/x.mda plain prompt, no front matter .claude/skills/x/SKILL.mdYAML front matter + instructions /x slash commandappears in the menu
Both routes land the same place. Most people now just write a skill — it’s the easiest way to get a new command, and it can do more.
Share with the team

If your .claude folder is committed to Git, everyone who clones the repo gets your commands and skills automatically. That is how a team standardises on shared shortcuts.

06Command vs sub-agent — an important distinction

When you run a command, everything it does becomes part of the main conversation history — Claude remembers the whole exchange. A sub-agent (next section) is different: it runs the task in a separate context and hands back only the result, so your main chat stays clean.

Hold this thought

Command / skill → work happens in your context. Sub-agent → work happens outside your context, and you get just the answer. That single difference is the whole point of Class 12.4.

✓ Key takeaways

  • A slash command is a saved prompt; drop a markdown file in .claude/commands/ and it exists.
  • $ARGUMENTS slots in whatever the user types after the command name.
  • Bake good habits (like “suggest simplifications”) into commands — but you accept or reject the output.
  • Every skill is also a slash command for free — the common way to make one today.
  • Commands run in your context; sub-agents run outside it — that’s next.