[DOCS] Clarify support for positional arguments ($1, $2, etc.) in Agent Skills

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jan 19, 2026 · closed Jan 26, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

Section/Topic

The "Available string substitutions" section in the Agent Skills documentation and the "Skill tool" section in the Slash Commands documentation.

Current Documentation

The Agent Skills documentation under "Available string substitutions" lists only:

| Variable | Description | | :--- | :--- | | $ARGUMENTS | All arguments passed when invoking the Skill... | | ${CLAUDE_SESSION_ID} | The current session ID... |

Meanwhile, the Slash Commands documentation explicitly details positional arguments:

Individual arguments with $1, $2, etc. Access specific arguments individually using positional parameters (similar to shell scripts)...

The Slash Commands page also notes:

In earlier versions of Claude Code, slash command invocation was provided by a separate SlashCommand tool. This has been merged into the Skill tool.

What's Wrong or Missing?

Since the SlashCommand tool and Agent Skills have been merged into a single Skill tool (as of v2.1.3), there is significant ambiguity regarding argument parsing for SKILL.md files:

  1. Parity: It is unclear if model-invoked Skills (which are now handled by the same underlying tool as Slash Commands) support the same $1, $2 positional substitutions that Slash Commands do.
  2. Model Behavior: If supported, the documentation doesn't explain how the model is instructed to provide space-separated arguments to a Skill to satisfy positional variables versus the catch-all $ARGUMENTS.
  3. Usage Guidelines: If positional arguments are not supported for Skills (only for Slash Commands), the documentation should explicitly state this limitation to prevent developers from attempting to use them in SKILL.md files.

Suggested Improvement

Update the "Available string substitutions" table in docs/en/skills.md to either:

  • Include $1, $2, ... $N with an explanation of how the model parses space-separated strings into these variables.
  • Add a note explicitly stating that positional arguments are currently reserved for manually-invoked Slash Commands and that model-invoked Skills should rely on $ARGUMENTS.

Additionally, update the Skill tool section in docs/en/slash-commands.md to clarify if the "merger" of these tools implies full feature parity for the Markdown files they reference.

Impact

High - Prevents users from using a feature

Additional Context

  • Related Documentation: Slash Commands - Individual arguments
  • Context: As developers move from simple Slash Commands to more complex Agent Skills, they often try to bring the same logic (like $1 for a filename and $2 for a mode) over. Without documentation, this leads to trial-and-error debugging of model outputs.

View original on GitHub ↗

4 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/17702
  2. https://github.com/anthropics/claude-code/issues/16163
  3. https://github.com/anthropics/claude-code/issues/16900

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

coygeek · 8 months ago

Thank you for the updates regarding the merger of Slash Commands and Agent Skills. After reviewing the current documentation, I have assessed the status of the requested clarifications regarding argument parsing.

What’s FIXED

  • Tool Merger Clarification: A note has been added to the top of https://code.claude.com/docs/en/skills explicitly stating: "Custom slash commands have been merged into skills." This resolves the confusion regarding the relationship between .claude/commands/ and .claude/skills/.
  • Unified Invocation Documentation: The documentation now confirms that files in both directories create the same user-facing / commands and that a skill entry (SKILL.md) takes precedence over a legacy command file.
  • Basic Argument Usage: The "Pass arguments to skills" section provides a clear example of using the $ARGUMENTS catch-all placeholder to handle user input.

What’s UNRESOLVED

  • Positional Argument Variables ($1, $2, etc.): The "Available string substitutions" table on https://code.claude.com/docs/en/skills still only lists $ARGUMENTS and ${CLAUDE_SESSION_ID}. It remains entirely undocumented whether positional variables ($1, $2, etc.) function within SKILL.md files as they did in legacy slash commands.
  • Model-Invoked Argument Mapping: There is no technical guidance on how the model is instructed to pass space-separated strings to satisfy positional variables when it invokes a skill autonomously.
  • Usage Limitations: If positional arguments are intentionally restricted to manual user invocation and are unsupported for model-invoked skills, this is not stated. Developers still face trial-and-error debugging when trying to migrate complex command logic (e.g., /fix $1 --mode=$2) into the SKILL.md format.

Conclusion

While the documentation successfully clarifies the architectural merger of these features, it remains technically incomplete regarding argument parsing parity. The core of my original request—documenting positional variable support and model behavior for those variables—has not been addressed.

I am keeping this issue open. To resolve this, the "Available string substitutions" table at https://code.claude.com/docs/en/skills must be updated to either define the behavior of $1..$N for the Skill tool or explicitly state that these substitutions are deprecated in favor of the $ARGUMENTS catch-all for model-invoked skills.

coygeek · 8 months ago

Issue #19355 Verification

Title: [DOCS] Clarify support for positional arguments ($1, $2, etc.) in Agent Skills
Issue Date: 2026-01-19
Verification Date: 2026-01-26
Status: RESOLVED

---

Issue Summary

This issue reported that the Agent Skills documentation was missing information about positional argument support ($1, $2, etc.), while the Slash Commands documentation included this feature. Since slash commands and skills were merged into a single Skill tool (as of v2.1.3), the reporter requested clarification on whether positional arguments work in SKILL.md files.

---

Verification Results

Claim 1: Skills documentation only lists $ARGUMENTS and ${CLAUDE_SESSION_ID}

Status: RESOLVED

The "Available string substitutions" table in the Skills documentation now includes all four variable types:

From [skills.md:184-189](docs/code.claude.com/docs/en/skills.md#L184-L189):

| Variable               | Description                                                                                     |
| :--------------------- | :---------------------------------------------------------------------------------------------- |
| `$ARGUMENTS`           | All arguments passed when invoking the skill...                                                 |
| `$ARGUMENTS[N]`        | Access a specific argument by 0-based index, such as `$ARGUMENTS[0]` for the first argument.   |
| `$N`                   | Shorthand for `$ARGUMENTS[N]`, such as `$0` for the first argument or `$1` for the second.     |
| `${CLAUDE_SESSION_ID}` | The current session ID...                                                                       |

Verdict: The documentation has been updated to include $ARGUMENTS[N] and $N shorthand.

---

Claim 2: No examples showing positional argument usage in Skills

Status: RESOLVED

The Skills documentation now includes concrete examples demonstrating positional argument usage.

From [skills.md:303-325](docs/code.claude.com/docs/en/skills.md#L303-L325):

---
name: migrate-component
description: Migrate a component from one framework to another
---

Migrate the $ARGUMENTS[0] component from $ARGUMENTS[1] to $ARGUMENTS[2].
Preserve all existing behavior and tests.

And the $N shorthand variant:

---
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.

The documentation explains: "Running /migrate-component SearchBar React Vue replaces $ARGUMENTS[0] with SearchBar, $ARGUMENTS[1] with React, and $ARGUMENTS[2] with Vue."

Verdict: Clear examples with both syntaxes are now documented.

---

Claim 3: Ambiguity about feature parity after slash commands merged into skills

Status: RESOLVED

The documentation now explicitly shows that skills support the same positional argument substitutions. The "Pass arguments to skills" section ([skills.md:277-325](docs/code.claude.com/docs/en/skills.md#L277-L325)) provides comprehensive coverage of argument handling in skills.

Verdict: Feature parity is now documented with examples.

---

Current State

| Claim | Status |
|-------|--------|
| $ARGUMENTS[N] missing from skills docs | RESOLVED |
| $N shorthand missing from skills docs | RESOLVED |
| No examples of positional arguments | RESOLVED |
| Ambiguity about slash command merger | RESOLVED |

---

Suggested Fix

None required. The documentation has been updated to address all concerns raised in this issue.

---

References

---

Conclusion & Recommendation

Primary Concern: Positional argument support ($1, $2, etc.) was undocumented for Agent Skills after the slash command merger.

Resolution Status: RESOLVED

Recommendation: CLOSE

The Skills documentation now includes complete coverage of positional arguments: the variable table lists $ARGUMENTS[N] and $N shorthand, and the "Pass arguments to skills" section provides working examples demonstrating both syntaxes.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.