Claude Code commands: the ones I use and how to make your own
The Claude Code slash commands worth knowing, the CLI flags behind them, and how to turn a prompt you keep retyping into your own /command in five minutes.
Short answer
Claude Code commands come in three kinds: built-in slash commands like /clear, /compact, /init and /model that control the session, CLI flags like claude -p and claude --continue that start it, and custom slash commands you write yourself as Markdown files. A custom command is a saved prompt: put it in .claude/commands/name.md or in a skill folder, and typing /name runs it, with $ARGUMENTS filled in from whatever you type after it.
Key takeaways
- Type / in Claude Code to see every command available in your session, built-in and custom. The list changes between versions, so trust that menu over any blog post.
- Five built-in commands carry most of the weight: /clear, /compact, /context, /init and /model.
- A custom command is one Markdown file. The file name becomes the command, the body becomes the prompt, and $ARGUMENTS passes in what you type after it.
- Project commands live in .claude/commands/ and can be shared through git. Personal ones live in ~/.claude/commands/ and work in every project.
- Make a command for any prompt you have typed three times. Make it a skill when Claude should also pick it up on its own.
Most people who start with Claude Code end up typing the same long prompts again and again. Check the open tasks, look at today's calendar, flag what is late. Word for word, pasted from a note.
That is exactly what a command is for. Once you know which commands already exist and how to make your own, Claude Code stops feeling like a chat window and starts feeling like a tool you set up once.
This guide covers the built-in commands worth learning, the terminal flags that start a session, and how to write custom commands with arguments.
What are Claude Code commands?
Claude Code commands are shortcuts you type to control a session or run a saved prompt, and they come in three kinds: built-in slash commands, command-line flags, and custom slash commands you write yourself.
| Kind | What it looks like | What it does |
|---|---|---|
| Built-in slash command | /clear, /compact, /model |
Controls the session you are in |
| CLI flag | claude -p "...", claude --continue |
Decides how a session starts |
| Custom slash command | /weekly-report, /review-pr 42 |
Runs a prompt you saved as a file |
Type / at the start of the prompt and Claude Code shows every command available right now. That menu is the source of truth. Anthropic ships new versions often, and commands get added, renamed or folded into others. If a command in this guide is missing in your version, the menu will tell you what replaced it.
Which built-in slash commands should you learn first?
The built-in commands to learn first are the ones that manage context, because a full or messy context is the most common reason Claude starts making odd choices. These are the ones I use daily:
| Command | What it does | When I use it |
|---|---|---|
/clear |
Starts a fresh conversation | Switching to an unrelated task |
/compact |
Replaces the history with a summary | Long task, context filling up |
/context |
Shows what is using your context window | Claude feels slow or forgetful |
/init |
Writes a starter CLAUDE.md for the project | First session in a new folder |
/memory |
Opens your memory files to edit | Correcting what Claude should always know |
/model |
Switches the model | Hard planning versus quick edits |
/resume |
Picks an earlier conversation | Continuing yesterday's work |
/permissions |
Shows and edits allow and deny rules | Too many prompts, or too few |
/mcp |
Lists connected MCP servers | A tool is not showing up |
/agents |
Manages subagents | Creating or editing a subagent |
/hooks |
Shows configured hooks | Checking a hook actually loaded |
The habit that matters most is /clear between tasks. A conversation that started on an invoice script and drifted into a blog post carries both into every answer. Clearing costs nothing. What should survive belongs in CLAUDE.md or memory, which is covered in my guide to Claude Code memory.
/compact is the softer version. It keeps you in the same task but shrinks the history. You can steer it: /compact keep the final pricing decisions and the file list tells Claude what the summary must hold on to.
Two shortcuts sit next to the slash commands. Start a line with ! to run a shell command directly, without Claude interpreting it. Type @ followed by a path to point Claude at a specific file.
Which terminal commands start Claude Code?
The terminal commands that start Claude Code are claude plus a few flags, and the most useful ones are -p for one-off runs and --continue or --resume for picking up old work.
claudeopens an interactive session in the current folder.claude "fix the failing test"opens a session with a first prompt already sent.claude -p "summarize today's errors"runs once, prints the answer and exits. This is the one for scripts and cron jobs.claude --continuereopens the most recent conversation in this folder.claude --resumelets you pick an older conversation from a list.
-p is where Claude Code turns from an assistant into infrastructure. You can pipe data into it, like cat errors.log | claude -p "group these by cause", and use the output in the next step of a script. Combined with a custom command, a scheduled job can run the same routine every morning without you opening a terminal. Add --output-format json when another program needs to read the result.
How do you create a custom slash command?
You create a custom slash command by saving a Markdown file in .claude/commands/, where the file name becomes the command and the file body becomes the prompt. That is the whole setup.
- Find the prompt you keep retyping. If you have pasted it three times, it qualifies.
- Create the folder.
.claude/commands/in your project, or~/.claude/commands/for a personal command that works everywhere. - Save the prompt as
name.md. The name is what you will type, so keep it short. - Add a description in the frontmatter, so the
/menu explains what it does. - Type
/namein Claude Code. If it does not show up, open a new session.
Here is a full example. Say you run a small agency and every Monday you want a client status overview:
---
description: Weekly status update for one client
argument-hint: [client name]
allowed-tools: Read, Grep, Glob
---
Write a weekly status update for $ARGUMENTS.
1. Read clients/$ARGUMENTS/notes.md and the files changed this week.
2. List what was delivered, what is in progress, and what is blocked.
3. Flag anything waiting on the client.
4. Keep it under 200 words, plain language, no jargon.
Do not send anything. Put the draft in drafts/$ARGUMENTS-status.md.
Typing /client-status acme replaces $ARGUMENTS with acme everywhere. For more than one input you can use $1, $2 and so on, like /compare $1 $2.
The frontmatter fields worth knowing:
| Field | What it does |
|---|---|
description |
Shown in the / menu |
argument-hint |
Shows what to type after the command |
allowed-tools |
Limits which tools Claude may use while the command runs |
model |
Runs the command on a specific model |
disable-model-invocation |
Stops Claude from triggering it on its own |
Two more tricks. A line like !`git status` runs that shell command first and puts the output into the prompt, so Claude starts with fresh facts. It needs the matching Bash permission in allowed-tools. And @path/to/file inside a command pulls that file into context. Subfolders work too: .claude/commands/sales/follow-up.md still runs as /follow-up, and the folder shows up in the description so you can tell similar commands apart.
Should you write a command or a skill?
Write a plain command when you decide the timing, and write a skill when Claude should also recognize the moment by itself. Recent versions of Claude Code merged the two: a skill in .claude/skills/client-status/SKILL.md also answers to /client-status.
| Use a command when | Use a skill when |
|---|---|
| You always start it by hand | Claude should spot when it applies |
| It is one prompt, no extra files | It needs templates, examples or scripts |
| It acts on the outside world, like sending or deploying | It is knowledge Claude should use without being asked |
For anything that sends, publishes or deploys, I keep the timing with a human. Either as a plain command or as a skill with disable-model-invocation: true. How to write a skill description that Claude actually picks up is in the skills guide.
Do custom commands actually save time?
Custom commands save time mostly by removing the rewriting and the forgetting, not by making Claude faster. The prompt is the same every run, so the output is consistent, and nobody on the team needs to remember the exact wording.
That consistency is the real point. METR ran a randomized trial in 2025 and found that seasoned open-source maintainers were 19% slower with AI help than without it, while they predicted the opposite. Speed does not come from the model alone. It comes from the setup around it. And in the Stack Overflow 2025 Developer Survey, 51% of professional developers said they use AI tools every day. Daily use is where retyping the same prompt adds up.
Commands are also how a Claude Code setup becomes something you can hand over. A colleague who clones the project gets your commands with it. I run large parts of my business through Claude Code, with me reviewing what goes out, and I walked through that daily routine in this article. If you want ready files to start from, my starter template files include a settings file and a starter skill, and there are more on the free resources page.
Where should you start?
Start with one command for the prompt you typed most this week, and use /clear between tasks from today. That alone changes how Claude Code feels.
After a week, look at what you still type by hand. Each repeated prompt is a command waiting to be written. Each command that Claude should trigger itself is a skill. Each rule that must never be broken is a hook. Small files, one at a time, until the setup does the routine work and you do the judging.
Frequently asked questions
How do I see all commands in Claude Code?
Type / at the start of the prompt in Claude Code. A menu opens with every slash command available in that session, including built-in commands, your own custom commands, skills and commands added by plugins or MCP servers. You can also run /help for an overview.
How do I create a custom slash command in Claude Code?
Create a Markdown file in .claude/commands/ in your project, for example .claude/commands/review-pr.md. The file name becomes the command, so this one runs with /review-pr. Write the prompt in the body and use $ARGUMENTS where the text you type after the command should go. For a personal command in every project, use ~/.claude/commands/ instead.
What is the difference between /clear and /compact?
/clear empties the conversation and starts fresh, so Claude forgets everything from that session except what is in CLAUDE.md and memory. /compact keeps working in the same session but replaces the history with a summary, which frees up context. You can add instructions, like /compact keep the decisions about pricing.
Are slash commands and skills the same thing in Claude Code?
They have merged. A file in .claude/commands/deploy.md and a skill in .claude/skills/deploy/SKILL.md both give you a /deploy command. The difference is that a skill can also be loaded by Claude on its own when a task matches its description, and it can carry extra files like templates and scripts.
How do I run Claude Code commands from the terminal without opening a session?
Use claude -p followed by your prompt to run once and print the answer, which works in scripts and cron jobs. Use claude --continue to pick up your last conversation, and claude --resume to choose an older one from a list.
- /8 oct 2026
Claude Code memory: how to make Claude remember your business
How Claude Code memory works: which CLAUDE.md files load, what auto memory saves, how imports and rules help, and how to keep it lean enough to follow.
- /7 oct 2026
Claude Code vs Cursor: which one fits the way you work
Claude Code vs Cursor compared: editor or agent, models, pricing, who each suits, and why business owners who don't code should start with Claude Code.
- /6 oct 2026
Claude Code hooks: rules Claude can't forget to follow
What Claude Code hooks are, which events you can hook into, how exit code 2 blocks an action, and five hooks worth adding to a business setup.
