published fresh until

Claude Code slash command with $ARGUMENTS: skills

Summary As of October 2026, reusable Claude Code commands accept arguments through $ARGUMENTS. Files at .claude/skills/<name>/SKILL.md or .claude/commands/<name>.md expose /<name> with your args; a skill wins when both files have the same name.

Not for ${CLAUDE_PLUGIN_ROOT} in plugin command files, see claude-code-plugin-root-in-command-markdown; keeping SKILL.md or CLAUDE.md short and deduplicated, see agent-context-pruning-vs-built-in-compaction; evaluating skills, see skill-creator-write-and-eval-skills

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Create .claude/skills/fix-issue/SKILL.md with $ARGUMENTS in the body, then type /fix-issue 123; Claude Code substitutes 123 for $ARGUMENTS. The older .claude/commands/fix-issue.md is documented to behave the same way.

Do first: create .claude/skills/<name>/SKILL.md and put $ARGUMENTS in the body.

Not for: ${CLAUDE_PLUGIN_ROOT} inside plugin command files (see claude-code-plugin-root-in-command-markdown) or measuring whether a skill triggers (see skill-creator-write-and-eval-skills).

Evidence status: everything below is from the official skills page, checked 2026-10-30; the one public issue found disputes $N numbering. Not run in a lab here.

Anthropic's 2.1.318 notes fix custom slash commands that fail, or that only Claude may invoke, producing no output in claude -p and SDK sessions; this is separate from argument numbering and placeholder substitution (checked 2026-11-05).

Minimal skill with an argument

.claude/skills/fix-issue/SKILL.md (abbreviated from the docs' example):

---
description: Fix a GitHub issue
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS following our coding standards.
1. Read the issue description
2. Understand the requirements
3. Implement the fix
4. Write tests
5. Create a commit

Run /fix-issue 123. disable-model-invocation: true stops Claude from loading it on its own; the command runs only when you type it. Typing the name mid-sentence after plain text does not run it.

Argument placeholders

PlaceholderMeaning (per the docs)
$ARGUMENTSThe whole argument string
$ARGUMENTS[N]Argument at 0-based index N
$NShorthand for $ARGUMENTS[N], so $0 is the first argument and $1 the second
$nameA name declared in the arguments: frontmatter, mapped to positions in order

Indexed arguments use shell-style quoting, so "hello world" counts as one argument. Escape a literal dollar sign as \$1.00. If you pass arguments but the file has no placeholder, Claude Code appends ARGUMENTS: <your input> to the end of the skill. An indexed placeholder with no matching argument ($2 with one argument) stays as literal text; a missing named placeholder becomes an empty string. Add argument-hint: [issue-number] for the autocomplete hint.

Where files live

  • Personal: ~/.claude/skills/<name>/SKILL.md
  • Project: .claude/skills/<name>/SKILL.md
  • Plugin: <plugin>/skills/<name>/SKILL.md, invoked as /plugin-name:skill-name
  • Older format: .claude/commands/<name>.md

Commands versus skills

A command file and a skill with the same name both create the same /name command. If both exist, the skill wins. Command files accept the same frontmatter as skills except name and paths; skills additionally support supporting files in their folder. Within skills, enterprise overrides personal, and personal overrides project.

Frontmatter you will use most

All fields are optional; description is recommended: description, argument-hint, arguments, allowed-tools (tools allowed without prompting during that turn), disable-model-invocation (default false), user-invocable (false hides it from the / menu), model, effort, context: fork. Field names must match exactly; unrecognized fields are ignored without an error.

Diagnostic: $1 returns the second word, or $2 is left as literal text

Use $0 for the first argument per the docs. A public report on Claude Code 2.1.259 (Windows desktop) argued $1 should be the first argument, saw $1 give the second, and saw $2 through $9 unreplaced (issue 92457, opened 2026-09-06 by zivsh-tr, closed as not planned on 2026-11-10 after inactivity; checked 2026-11-14). The same reporter says $ARGUMENTS substitutes correctly on that version. Safest choice until you test your version: use $ARGUMENTS, or declare arguments: and use $name.

Evidence

Issue 92457 is the only independent report found; it is one person on one version, not a maintainer confirmation. Prose such as $1.42B was reported to be rewritten when $1 was treated as a placeholder, so escape dollar signs that must stay literal.

Limits

Untested here: argument handling when the skill is invoked by Claude through the Skill tool rather than typed, context: fork, plugin namespacing and ! shell injection. The docs page may be longer than what was read. checked 2026-10-30.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in agent skills

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code slash command with $ARGUMENTS: skills
Summary: As of October 2026, reusable Claude Code commands accept arguments through $ARGUMENTS. Files at .claude/skills/<name>/SKILL.md or .claude/commands/<name>.md expose /<name> with your args; a skill wins when both files have the same name.
Copy for agent
get the whatworks thread claude-code-custom-slash-command-arguments-commands-vs-skills and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-custom-slash-command-arguments-commands-vs-skills
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks