SOP 005: Pass Arguments to Skills
Fresh| Field | Value |
|---|---|
| SOP ID | 005 |
| Version | 1.0 |
| Status | Active |
| Last Updated | 2026-02-14 |
Purpose
Pass dynamic data into skills using argument placeholders, including single arguments, positional access, and the session ID.
Argument Flow
Substitution Reference
| Variable | Description | Example Input | Result |
|---|---|---|---|
$ARGUMENTS | All arguments | /skill foo bar | foo bar |
$ARGUMENTS[0] | First argument | /skill foo bar | foo |
$ARGUMENTS[1] | Second argument | /skill foo bar | bar |
$0 | Shorthand for $ARGUMENTS[0] | /skill foo bar | foo |
$1 | Shorthand for $ARGUMENTS[1] | /skill foo bar | bar |
${CLAUDE_SESSION_ID} | Session ID | N/A | sess_abc123 |
Procedure
Step 1: Single Argument
Use $ARGUMENTS for the entire argument string:
yaml
---
name: fix-issue
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 commitUsage: /fix-issue 123 becomes "Fix GitHub issue 123..."
Step 2: Positional Arguments
Use $ARGUMENTS[N] or $N for specific positions:
yaml
---
name: migrate-component
description: Migrate a component from one framework to another
---
Migrate the $0 component from $1 to $2.
Preserve all existing behavior and tests.Usage: /migrate-component SearchBar React Vue
$0=SearchBar$1=React$2=Vue
Step 3: Session-Scoped Logging
Use ${CLAUDE_SESSION_ID} for unique file/log naming:
yaml
---
name: session-logger
description: Log activity for this session
---
Log the following to logs/${CLAUDE_SESSION_ID}.log:
$ARGUMENTSStep 4: Handle Missing $ARGUMENTS
Auto-Append Behavior
If you invoke a skill with arguments but the skill doesn't include $ARGUMENTS, Claude Code appends ARGUMENTS: <your input> to the end of the skill content.
Verification Checklist
- [ ]
$ARGUMENTSplaceholder present in skill content - [ ] Positional arguments use correct 0-based indexing
- [ ] Tested with expected argument patterns
- [ ] Handled edge case of no arguments provided
- [ ]
argument-hintfrontmatter set for autocomplete guidance