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.
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.
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.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:
> /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?)
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.
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.
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. $ARGUMENTSslots 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.