Faqs
Claude Code Custom Command Arguments and Skills
Learn how Claude Code custom command arguments work in slash commands and when to use skills with argument-hint, named arguments, and supporting files.
Claude Code Custom Command Arguments
The simplest argument is just the text you type after the slash command.
Last checked on July 7, 2026. Current Claude Code docs position skills as the richer path for custom workflows, while existing
.claude/commands/*.mdprompts still work for simple slash commands.
Quick Answer
/explain src/app/page.tsxIn that example, src/app/page.tsx is the argument text the custom command should use.
For structured arguments, use a skill:
---
name: explain-file
description: Explain a file and identify risky changes
argument-hint: '<file path>'
arguments:
- name: file
description: File to inspect
required: true
---Slash Command vs Skill Arguments
| Need | Use |
|---|---|
| One prompt with free text after the command name | .claude/commands/*.md |
| Named or documented arguments | Skill |
| Autocomplete hint for expected input | Skill argument-hint |
| Supporting files, scripts, or examples | Skill |
| Team workflow that should be portable | Skill |
Practical Pattern
Use a short command for simple transformations:
/rewrite-title Make this clearer for a docs homepageUse a skill when you need repeatable behavior:
/explain-file src/server/auth.tsThe skill can document what the file argument means, what checks to run, and what output format to return.
Common Mistakes
- Expecting
.claude/commands/*.mdto validate argument types automatically. - Hiding required inputs inside prose instead of documenting them.
- Building a complex workflow as a single prompt when it needs supporting scripts.
- Using a global command for a repository-specific workflow.