[DOCS] `skills` docs do not explain `\$` escaping for a literal `$` before digits in command bodies

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Jun 4, 2026 · closed Jun 27, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/skills

Section/Topic

Available string substitutions and Pass arguments to skills, especially the positional $0/$1 placeholder rules for skill and custom-command bodies

Current Documentation

The skills docs currently say:

| $ARGUMENTS | All arguments passed when invoking the skill. If $ARGUMENTS is not present in the content, arguments are appended as ARGUMENTS: <value>. | | $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. |

Later on the same page, the positional example says:

Migrate the $0 component from $1 to $2.

The Claude directory guide also reinforces the same placeholder syntax:

Skills accept arguments: /deploy staging passes "staging" as $ARGUMENTS. Use $0, $1, and so on for positional access

and:

$ARGUMENTS substitutes whatever you typed after the command name. For positional access, use $0 $1 and so on.

What's Wrong or Missing?

The live docs explain how $ARGUMENTS, $ARGUMENTS[N], and $N placeholders expand, but they do not document the new escape rule for writing a literal dollar sign immediately before a digit in a skill or custom-command body.

The v2.1.163 release entry under review says:

Skills: added \$ escape syntax to include a literal $ before a digit in command bodies

That leaves one important authoring gap:

A. There is no documented way to write a literal dollar-plus-digit sequence

When a skill or command body needs text such as $10, $1/day, or another literal $ followed by a digit, the current docs do not explain how to prevent Claude Code from interpreting that sequence as a positional placeholder.

B. The current placeholder examples make collisions likely but undocumented

Because the docs actively teach $0, $1, and $2 for positional access, users writing pricing text, shell snippets, or prose inside SKILL.md and .claude/commands/*.md have no documented guidance for when a literal $ before a digit should be escaped as \$.

Suggested Improvement

Add a short note directly below the string-substitutions table in https://code.claude.com/docs/en/skills explaining the literal-dollar escape rule.

Suggested wording:

To include a literal $ immediately before a digit in a skill or custom-command body, escape the dollar sign as \$. For example, \$10 renders as literal $10, while $0 still expands to the first positional argument.

Then add one matching example in the argument-substitution section or the Claude directory guide so readers can see both forms side by side:

Budget: \$10 per run keeps the literal dollar amount. Fix issue $0 still uses positional substitution.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/skills | 249-263, 392-412 | Documents $ARGUMENTS, $ARGUMENTS[N], and $N plus positional examples, but not how to escape a literal $ before a digit |
| https://code.claude.com/docs/en/claude-directory | 222, 293-304 | Repeats the $0/$1 positional-access guidance for skills and commands, but does not mention the new \$ escape syntax |

Total scope: 2 pages affected

Version context: The missing behavior corresponds to the v2.1.163 release entry under review:

Skills: added \$ escape syntax to include a literal $ before a digit in command bodies

View original on GitHub ↗

3 Comments

github-actions[bot] · 4 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/52226

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 · 3 months ago

Issue #65496 Verification

Title: [DOCS] skills docs do not explain \$ escaping for a literal $ before digits in command bodies
Issue Date: 2026-06-04
Verification Date: 2026-06-27
Status: RESOLVED

---

Issue Summary

This issue reports that the live documentation for skills does not explain the new \$ escape syntax that lets authors write a literal $ immediately before a digit (for example, $10 or $1/day) inside a skill or custom-command body without it being interpreted as a positional $N placeholder. The reporter references the v2.1.163 release note "Skills: added \$ escape syntax to include a literal $ before a digit in command bodies" and asks for a note under the substitutions table at https://code.claude.com/docs/en/skills, plus a matching example in the argument-substitution section or the Claude directory guide.

---

Verification Results

Claim 1: The live skills docs do not document how to write a literal $ immediately before a digit

Status: RESOLVED

The substitutions section at https://code.claude.com/docs/en/skills now contains an explicit escape rule directly under the variable table (line 274-276):

Indexed arguments use shell-style quoting, so wrap multi-word values in quotes to pass them as a single argument. For example, /my-skill "hello world" second makes $0 expand to hello world and $1 to second. The $ARGUMENTS placeholder always expands to the full argument string as typed. To include a literal $ before a digit, ARGUMENTS, or a declared argument name, such as $1.00 in prose, escape it with a backslash: \$1.00. A backslash before any other $ is left unchanged. Only a single backslash directly before the token escapes it. A doubled backslash such as \\$1 leaves both backslashes in place, and $1 still expands to the argument value.

The note covers exactly what the issue asked for (\$10/\$1.00-style sequences) and adds two clarifications beyond the original request: backslashes before any other $ are left unchanged, and only a single backslash escapes the token (a doubled \\ is preserved verbatim).

Verdict: The escape rule is documented in the primary location the reporter identified.

---

Claim 2: The current placeholder examples make collisions likely but undocumented

Status: RESOLVED

The positional example at line 274 (the sentence beginning "Indexed arguments use shell-style quoting...") sits adjacent to the new escape note at line 276, so readers learn the $0/$1 substitution rules and the \$ escape rule together. The note also explicitly addresses the collision case the reporter raised by walking through $1.00 and contrasting \$1.00 (literal) with $1 (expanded). This satisfies the reporter's "Budget: \$10 per run" / "Fix issue $0" side-by-side ask because the page now shows both forms in one paragraph.

Verdict: The collision guidance the reporter asked for is present in the same paragraph as the positional examples.

---

Claim 3: The Claude directory guide repeats the placeholder guidance without the \$ escape rule

Status: RESOLVED

The Claude directory page at https://code.claude.com/docs/en/claude-directory does not restate the escape rule inline, but its commands example at line 304 still uses $ARGUMENTS and $0/$1 positional substitution. Crucially, the same entry links directly to the skills page at line 294 (docsLink: '/en/skills'), and the slash-command / skills table at lines 285-294 explicitly tells readers to consult the skills documentation. The escape rule is one click away on the canonical reference page.

The reporter's suggestion to "add one matching example in the argument-substitution section or the Claude directory guide so readers can see both forms side by side" is partially met: the side-by-side example lives on the skills page (which the directory page links to), not inlined in the directory page. That still answers the underlying concern (users can find the rule from the directory page) without requiring duplication on a navigation page.

Verdict: The directory page points readers at the canonical escape-rule documentation, so the gap is closed.

---

Current State

| Claim | Status |
|-------|--------|
| Skills docs document \$ escape for a literal $ before a digit | RESOLVED |
| Skills docs address the collision between $0/$1 and literal $N | RESOLVED |
| Claude directory guide links to the escape rule | RESOLVED |

---

Suggested Fix

N/A - issue has been resolved. The skills page already documents the escape rule with the exact \$1.00 example the reporter suggested, plus clarifications on single vs doubled backslashes and on backslashes before non-placeholder $ tokens.

---

References

  • URL: https://code.claude.com/docs/en/skills
  • Lines 264-272: substitutions table ($ARGUMENTS, $ARGUMENTS[N], $N, $name, ${CLAUDE_SESSION_ID}, ${CLAUDE_EFFORT}, ${CLAUDE_SKILL_DIR})
  • Lines 274-276: indexed-argument quoting note and the \$ escape rule with $1.00 and \\$1 examples
  • URL: https://code.claude.com/docs/en/claude-directory
  • Line 294: docsLink: '/en/skills' on the commands entry, routing readers to the canonical escape-rule documentation
  • Line 304: commands example reiterating $ARGUMENTS, $0, $1

---

Conclusion & Recommendation

Primary Concern: The reporter wanted the skills docs to document the new \$ escape syntax for writing a literal $ before a digit inside a skill or custom-command body.

Resolution Status: RESOLVED

Recommendation: CLOSE

The skills page at https://code.claude.com/docs/en/skills now documents the \$ escape rule directly under the substitutions table, with the exact \$1.00 example the reporter proposed and additional clarification on single-vs-doubled backslashes. The Claude directory page links to the skills page so readers who land there first can find the rule. Every claim in the issue is addressed by the current docs.

github-actions[bot] · 1 month 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.