Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model’s context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Prompt Caching CalculatorEstimate savings from prompt caching.Tool

Coding Agents

Claude Code slash command builder

Build a custom Claude Code slash command with arguments, live shell context and pre-approved tools, starting from a code review, test or security audit example, or paste a command file to check it. It’s free and runs in your browser.

Start from an example

The file name, and what you type after /.

Adds a prefix: /frontend:name.

Shown in the / menu.

Shown in the / menu, and how Claude decides whether to run it on its own.

Space-separated permission rules. Approved without asking for the turn the command runs; every other tool still works with the usual prompts.

Space-separated. With “issue branch”, $issue is the first argument and $branch the second.

Applies for the rest of the turn; your session model returns with your next prompt.

What Claude receives when you run the command. $ARGUMENTS is everything you typed after it; $0 is the first argument.

Save as .claude/commands/review-changes.md, then type /review-changes [focus area]

review-changes.md
---
description: Review uncommitted changes for bugs, security problems and missing tests
argument-hint: "[focus area]"
allowed-tools:
  - Bash(git status *)
  - Bash(git diff *)
---

## Changes
- Status: !`git status --short`
- Diff: !`git diff HEAD`

## Your task
Review the changes above. Focus on $ARGUMENTS if given.

Group findings as Must fix, Should fix and Consider. For each one, give the file and line, the problem in one sentence and a concrete fix. Don't edit any files.

Checking…

Everything stays in your browser. Your draft is saved on this device.

Steps

How to use the Claude Code slash command builder

  1. Pick an example close to what you want, or start blank.
  2. Name the command (the name is the file name and what you type after /) and describe it.
  3. Write the prompt, using $ARGUMENTS or $0 for what you type after the command, and !`command` for live context.
  4. Add allowed-tools for every ! command and for tools it should use without asking, then fix anything the checks flag.
  5. Download the file into .claude/commands/ (or ~/.claude/commands/) and type the command in Claude Code.

Method

How it works

A custom slash command is a Markdown file whose body is a prompt. Type /review-changes and Claude Code sends Claude that prompt, with your arguments and any live command output filled in. It saves you retyping the same instructions, and lets a team share them through git.

Commands are now part of skills

Anthropic has merged custom commands into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and work the same way, and existing command files keep working. A command file accepts the same frontmatter as a skill except name and paths; if a command and a skill share a name, the skill runs. Skills add a folder for supporting files, which is why Anthropic recommends them for new work. This builder writes command files, the single-file format; for a skill with supporting files, use the claude skill generator.

Arguments count from zero

$ARGUMENTS is everything you typed after the command. For single arguments, use $ARGUMENTS[0] or its shorthand $0: positions start at zero, so in /migrate SearchBar React Vue, $0 is SearchBar and $1 is React. Many older guides start at $1; the checker points this out when a body uses $1 but never $0. Arguments use shell-style quoting, an indexed placeholder with no argument stays as literal text, and if the body has no placeholder at all, Claude Code appends what you typed as ARGUMENTS: … so Claude still sees it.

Live context with !

A line such as - Diff: !`git diff HEAD` runs the command before Claude sees anything and replaces it with the output, so the prompt arrives with the current diff already in it. The ! must start a line or follow whitespace; for several commands, use a fenced block that opens with ```!. These commands never show a permission prompt: Claude Code checks them against your permission rules, and outside auto mode anything not allowed cancels the whole command. The fix is a matching rule in allowed-tools, such as Bash(git diff *), which the builder suggests for every ! command it finds. A command that exits with an error also cancels it, so append || true to checks that can fail.

allowed-tools grants, it doesn’t limit

allowed-tools approves the listed tools for the turn the command runs; the grant clears with your next message. Every other tool stays available under your usual permission settings. To remove tools while the command is active, use disallowed-tools. Workspace trust doesn’t gate this field, so review the allowed-tools of commands in a repository you’ve just cloned.

Who can run it

By default both you and Claude can run a command: Claude sees its description and can start it when it looks relevant. disable-model-invocation: true makes it yours only, which suits deploys, commits and anything with side effects. context: fork runs it in a subagent, such as the read-only Explore, without your conversation history.

The builder and checker run in your browser and nothing is sent anywhere. Rules checked against Claude Code’s documentation on 2026-10-12 (latest release 2.1.296).

Examples

Worked examples

.claude/commands/review-changes.md
---
description: Review uncommitted changes for bugs, security problems and missing tests
argument-hint: "[focus area]"
allowed-tools:
  - Bash(git status *)
  - Bash(git diff *)
---

## Changes
- Status: !`git status --short`
- Diff: !`git diff HEAD`

## Your task
Review the changes above. Focus on $ARGUMENTS if given.

Group findings as Must fix, Should fix and Consider. For each one, give the file and line, the problem in one sentence and a concrete fix. Don't edit any files.

/review-changes security runs both git commands first, so Claude starts with the diff in front of it. allowed-tools pre-approves both. They’re read-only git commands, which Claude Code usually allows anyway, but any ! command your rules don’t allow cancels the whole command.

.claude/commands/fix-issue.md
---
description: Fix a GitHub issue by number
argument-hint: "[issue-number]"
allowed-tools:
  - Bash(gh issue view *)
disable-model-invocation: true
---

Fix GitHub issue #$0.

1. Read it with `gh issue view $0`.
2. Find the code involved and the cause.
3. Make the fix and add a test that fails without it.
4. Run the tests, then summarise the change in two or three sentences.

/fix-issue 482 puts 482 wherever $0 appears. disable-model-invocation stops Claude starting it on its own.

Placeholders you can use in the body

WriteBecomes
$ARGUMENTSEverything typed after the command, as typed.
$ARGUMENTS[0], $ARGUMENTS[1] …One argument by position, counting from 0. Quote multi-word values: /cmd "hello world" next.
$0, $1 …Shorthand for $ARGUMENTS[0], $ARGUMENTS[1]. $0 is the first argument.
$nameA named argument from the arguments field, mapped to positions in order.
${CLAUDE_SESSION_ID}The current session ID.
${CLAUDE_PROJECT_DIR}The project root, for scripts that must resolve the same way every time.
${CLAUDE_EFFORT}The current effort level.
!`command`Runs the shell command first and puts its output in the prompt.
\$1A literal $1 (for prices like \$1.00).

FAQ

Frequently asked questions

Are custom slash commands still supported in Claude Code?

Yes. Anthropic merged custom commands into skills, but files in .claude/commands/ keep working: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy and behave the same way. A command file takes the same frontmatter as a skill except name and paths. If a skill and a command share a name, the skill runs.

Where do I put custom slash commands?

In .claude/commands/ inside your project to share them with the team through git, or ~/.claude/commands/ for your own commands in every project. The file name becomes the command: deploy.md gives /deploy. Subfolders become a prefix joined with a colon, so commands/frontend/component.md is /frontend:component.

How do I pass arguments to a slash command?

Use $ARGUMENTS for everything typed after the command, or $0, $1 and so on for single arguments. Positions count from zero, so $0 is the first argument, which trips up people following older guides that start at $1. Wrap multi-word values in quotes. If the body has no placeholder, Claude Code appends what you typed as ARGUMENTS: ….

What does allowed-tools do in a command?

It pre-approves the listed tools, such as Bash(git diff *), so Claude can use them without asking during the turn the command runs. The grant ends with your next message. It doesn’t restrict anything: other tools still work under your normal permission settings. To take tools away while the command runs, use disallowed-tools.

How do I run a shell command inside a slash command?

Write an exclamation mark followed by the command in backticks, at the start of a line or after a space, so git diff HEAD becomes ! plus that command in backticks. Claude Code runs it before Claude sees the prompt and inserts the output. It doesn’t ask permission at that point: if your rules don’t allow the command, the whole command is cancelled, so add a matching rule to allowed-tools. Commands in Claude Code’s built-in read-only set, such as git status and ls, count as allowed without a rule.

Should I write a command or a skill?

For a single prompt you trigger yourself, a command file is the simplest thing that works. Choose a skill when you need supporting files next to the prompt (templates, scripts, reference docs), when you want to set name or limit it to certain paths, or for anything new you plan to grow, since Anthropic recommends skills for new work.

Why doesn’t my command show up in the / menu?

Check that the file is in .claude/commands/ or ~/.claude/commands/ and ends in .md, then run /reload-skills, which the commands reference says re-scans skill and command folders without a restart. A command in a folder added with --add-dir is the exception: Claude Code doesn’t watch that folder’s .claude/commands/, so restart the session after changing it. Also check for a skill with the same name, which wins, and for user-invocable: false, which hides it from the menu.