Claude Code, the easy way
Jul 29, 2026
4 min read

Custom slash commands for the work you repeat

Turn the prompts you keep retyping into one-word Claude Code commands, with arguments and live data, plus three ready-to-copy examples for creators and operators.

You probably have a prompt you've typed fifty times. "Turn this post into five LinkedIn posts, in my voice, no hashtags, save them in social/." Every week, from memory, slightly differently.

A custom slash command saves that prompt in a file, so next time you type /repurpose and the rest happens the same way it did last time.

Built-in commands and your own

Anything you type in Claude Code that starts with / is a command. There are three kinds in the menu:

  • Built-in commands are part of Claude Code itself: /help, /clear, /rewind, /usage, /model, /plan. They control the app.
  • Bundled skills ship with Claude Code but work like prompts handed to Claude, such as /code-review and /doctor.
  • Your commands are prompts you've saved. Plugins and connected tools (MCP servers) can add commands too.

Type / to see everything available to you, and keep typing to filter. A command only counts at the start of your message; whatever you type after its name becomes its arguments.

Commands and skills have merged

If you've read older guides, this part changed. Anthropic's docs now say it plainly: custom commands have been merged into skills. A file at .claude/commands/repurpose.md and a skill at .claude/skills/repurpose/SKILL.md both create /repurpose, and they work the same way.

So what's the difference?

Command fileSkill folder
Where.claude/commands/name.md.claude/skills/name/SKILL.md
ShapeOne Markdown fileA folder, with room for templates and scripts
FrontmatterSame fields, except name and pathsAll fields
Same name in bothLosesWins

Your existing command files keep working, and the docs recommend skills for new work, mainly because a folder can hold supporting files. In practice: a one-page prompt you only ever trigger yourself is fine as a command file. Once it needs a template, a voice guide or a script, move it into a skill folder. The skills guide covers that side in depth; this article sticks to the short, single-file kind.

Where command files live

LocationPathAvailable in
Project.claude/commands/This project
Personal~/.claude/commands/Every project on your computer

Use personal commands for habits that follow you everywhere, like a final proofread, and project commands for anything tied to one folder's files.

The file name becomes the command: weekly-review.md gives you /weekly-review. Subfolders become a prefix with a colon, so .claude/commands/social/thread.md is /social:thread. That's handy once you have a dozen.

Avoid naming yours after a built-in like help or clear. The docs say a skill with a built-in's name replaces that built-in in a local terminal session, which is rarely what you want.

The format

A command file is a Markdown file whose body is the prompt. Optionally, it starts with frontmatter, a short settings block between two --- lines. The fields you'll use most:

FieldWhat it does
descriptionShown in the / menu. Without one, Claude Code uses the first line of the body
argument-hintA hint shown as you type, like [file] [platform]
argumentsNames for your arguments, so you can write $platform instead of $1
allowed-toolsTools Claude can use without asking, only during the turn that runs the command
disable-model-invocationSet to true so it only runs when you type it
modelUse a specific model for that turn

Arguments

Whatever you type after the command name is available inside the file:

  • $ARGUMENTS is everything, exactly as typed.
  • $0, $1, $2 are the first, second and third arguments, split on spaces. Counting starts at zero.
  • Wrap multi-word values in quotes: /repurpose drafts/pricing.md "LinkedIn and Threads" makes $1 the whole phrase.
  • If the file has no placeholder at all, Claude Code adds your text to the end as ARGUMENTS: so nothing gets lost.

Numbers get hard to read once there are three of them. Name them instead: add arguments: [file, platform] to the frontmatter and write $file and $platform in the body. A small bonus: a named argument you leave out becomes empty, while a numbered one you leave out stays in the prompt as literal text.

One gotcha for anyone who writes about money: in $1.00, Claude Code would swap the $1 for your second argument. Write \$1.00 instead.

Live data with the exclamation mark

A line that starts with an exclamation mark followed by a command in backticks runs that command before Claude sees the prompt, and swaps in the output. So the prompt arrives with today's date, or a list of this week's files, already filled in. You'll see it in the second example below.

Three things to know. If the command fails, the whole command is cancelled. Outside auto mode, a command that your permission rules don't already allow also cancels it, which is why the example pre-approves its commands with allowed-tools. And those commands run on your computer, so read any command file you didn't write before you use it. The examples below assume macOS or Linux.

Example 1: repurpose a post

.claude/commands/repurpose.md
---
description: Turn a long post into short social posts in the house voice
argument-hint: [post file] [platform]
---

Read $0. Write five short posts for $1 based on it.

- Each post stands alone: one idea, no thread numbering.
- Follow the voice rules in CLAUDE.md.
- Only quote the original word for word. Don't invent stats or results.
- Save all five to social/ in one file named after the post, then show them here.
- Don't post or schedule anything.

Run it with /repurpose drafts/2026-07-pricing.md LinkedIn. The voice rules live in your CLAUDE.md, so the command stays short.

Example 2: the weekly operator review

.claude/commands/weekly-review.md
---
description: Write this week's operator review from the ops log
disable-model-invocation: true
allowed-tools: Bash(date *) Bash(find ops *)
---

Today is !`date +%Y-%m-%d`.

Notes changed in ops/ in the last 7 days:
!`find ops -name "*.md" -mtime -7`

Read those files, then write reviews/[today's date].md with four sections:
1. Shipped: what got done, one line each.
2. Stuck: anything waiting more than a week, and what it's waiting on.
3. Numbers: copy figures from the notes exactly. Never estimate or fill gaps.
4. Next week: the three things that matter most.

Keep it under 400 words. If no notes changed this week, say so and stop.

The two exclamation-mark lines hand Claude the date and the file list up front, so it doesn't have to go looking. allowed-tools approves exactly those two commands, and nothing broader.

Example 3: draft a support reply

.claude/commands/support-reply.md
---
description: Draft a reply to a customer email using our written policies
argument-hint: [paste the customer's email]
---

Draft a reply to this customer email:

$ARGUMENTS

1. Read docs/policies.md and docs/faq.md first.
2. Answer only what they asked, in a friendly, brief tone.
3. Take prices, dates and terms from those files, word for word.
4. If the answer isn't in the policies, don't guess. Write [NEEDS ME]
   and say what's missing.
5. Never promise a refund, discount or deadline the policies don't cover.
6. Show the draft here. Don't send anything.

Type /support-reply, a space, then paste the email. The rules at the bottom are the important part: a draft that invents a refund policy is worse than no draft. Keep a human between the draft and the send button, and keep customer emails out of any folder you share publicly.

Make your first one in five minutes

  1. Pick the prompt you've typed most this month. Scroll back through old chats if you need to.
  2. Create .claude/commands/ in your project and save the prompt as a .md file named for the command.
  3. Swap the parts that change each time for $ARGUMENTS, or $0 and $1.
  4. Add a description and an argument-hint so future-you knows what it's for.
  5. Run it three times on real work. Each time it gets something wrong, fix the file, not the chat.

If a command is about to touch lots of files, try it in plan mode first. And if you're new to all of this, start with your first hour.

Sources