Writing your own slash command
You’ve got a prompt you type all the time. Maybe it’s “review my staged changes for bugs and security issues, and don’t be shy about style.” You type some version of it three times a day, never quite the same way twice.
Bottle it up once.
A custom slash command is a prompt saved in a file. The filename becomes the command. The contents are the prompt Claude runs when you type it.
That’s the entire concept. There’s no programming. If you can write a prompt — and you’ve been doing that for nine levels — you can write a slash command.
Making one
Create a folder called .claude/commands/ in your project, and put a markdown file in it. Say you make .claude/commands/review.md:
Review my staged git changes for bugs, security issues, and
anything that would confuse a future reader. Be direct. Group
your findings by severity.
Save it. Now type /review in that project, and Claude runs exactly that prompt — every time, worded the same way, no retyping. The filename (review.md) is the command name (/review).
That’s it. You wrote a prompt and gave it a name.
Passing it input
Often you want the command to work on something you name when you run it. You can drop a $ARGUMENTS placeholder into the prompt, and whatever you type after the command lands there:
Explain what the file $ARGUMENTS does, in plain English,
to someone who's never seen this codebase.
Save that as explain.md, then run /explain src/auth.js — and $ARGUMENTS becomes src/auth.js. One command, reusable on anything.
Where to put it, and who gets it
You’ve seen this shape already with CLAUDE.md:
.claude/commands/in the project → committed to the repo, so your whole team gets the command.~/.claude/commands/in your home folder → personal, available in every project, just for you.
Same rule as everything else in this level: shared workflows go in the repo, personal ones go in your home folder.
A command in the repo is a way to hand your teammates a good prompt they don’t have to think up themselves.
That last part is quietly powerful. A well-written /review or /ship command means everyone on the team gets your best prompt for that task — not whatever they’d improvise.
What’s next
Context, memory, commands — you’ve personalized what Claude knows and what it can do on demand. One friction is left: the permission prompts. The next lesson finally shows you how to write down the allowlist Level 6 promised — so Claude stops asking about the boring stuff.