Module 06

Slash commands: your reusable shortcuts

Developer Tools How Claude Code Works

Module 6 — Slash commands: your reusable shortcuts

← Module 5 | Index | Next: Module 7 →


A slash command is a saved prompt you can fire with a short name, like /init or /review. Instead of retyping a long instruction every time, you save it once and call it.

Built-in commands handle the tool itself — for example /clear and /compact (from Module 4), /init (Module 1), /help, and so on.

Custom commands are yours to define. Each is just a markdown file in .claude/commands/. The filename becomes the command name. The file’s contents become the prompt that runs.

A simple example

Create .claude/commands/changelog.md:

Summarize the git commits since the last release and
write them as a user-facing changelog in CHANGELOG.md.

Now typing /changelog runs that instruction.

Commands can take arguments (so /fix-issue 123 can pass the number 123 into the prompt), can be scoped to a project or to you personally (project commands live in the project’s .claude/commands/, personal ones in ~/.claude/commands/), and can arrive bundled inside plugins.

Command vs. skill — what’s the difference?

A slash command is something you trigger by name — a shortcut for a prompt you got tired of typing. A skill is something Claude triggers automatically when your request matches its description.

Use a command when you want a button to press. Use a skill when you want Claude to know how to do something whenever it comes up.


← Module 5 | Index | Next: Module 7 →