Pass Arguments to Skills
Skills become far more reusable when they accept arguments — text, filenames, flags, or named parameters typed inline after the slash command. Claude reads what the user types and your SKILL.md instructions tell it how to interpret each part.
How argument passing works
Claude skills don't have a formal argument parser — Claude itself reads everything the user types after the slash command and interprets it according to your instructions. Your SKILL.md tells Claude what to expect and how to use each piece.
from=, to=) makes parsing reliable and predictable.Three ways to pass arguments
Example 1 — /translate with named parameters
The description field is where you document the argument syntax — Claude and auto-detection both read it. The ## Steps section tells Claude how to parse each argument.
Example 2 — /commit with an optional hint
Arguments can be optional. When the user types /commit alone, Claude generates the message from staged changes. When the user adds a hint like"login page", Claude uses it as the subject. Document both forms in the description.
Example 3 — /review with a severity flag and filename
Flags change the skill's mode of operation. Here, the first argument selects severity level and the second is the filename. Both are optional — the skill defaults gracefully when they are missing.
Always document arguments in the description
The description field is read by Claude during auto-detection and by users who run /help. Use a consistent three-line format: what it does, usage syntax, and an example.
| Line in description | Purpose | Example |
|---|---|---|
What it does | One sentence — what the skill produces | "Translate text between any two languages." |
Usage: | Argument pattern with <required> and [optional] | "Usage: /translate <text> from=<lang> to=<lang>" |
Example: | A concrete invocation for the user to copy | "Example: /translate \"Hi\" from=en to=fr" |
Outputs: | Shape of the response | "Outputs: translated text + optional tone note." |
Always define defaults for optional arguments
If an argument is optional, your ## Steps or ## Constraints must say what Claude should do when it is absent. Without a default, Claude will ask the user — or guess — which leads to inconsistent behaviour.
/review, Claude guesses or asks — inconsistent.What's Next
Arguments make skills flexible. The next lesson goes further — using dynamic context to inject live information into your skill at runtime.