$ARGUMENTS substitution does not work in skills with context: fork
Bug
When a skill with context: fork in frontmatter is invoked by another skill via the Skill() tool, $ARGUMENTS, $ARGUMENTS[0], and $ARGUMENTS[1] are not substituted. The forked context receives the raw template with literal placeholder text. The model then misinterprets $ARGUMENTS[1] (the literal text in the second argument definition) as the value of $ARGUMENTS[0].
Without context: fork, argument substitution works correctly.
Reproduction
1. Create skill-a (the caller):
---
name: skill-a
---
Invoke Skill("skill-b") with args "hello world".
Report what skill-b returned.
2. Create skill-b (the callee, with context: fork):
---
name: skill-b
context: fork
argument-hint: [arg1] [arg2]
---
## Inputs
- FIRST = $ARGUMENTS[0]
- SECOND = $ARGUMENTS[1]
Report the values of FIRST and SECOND.
3. User invokes skill-a: /skill-a
4. Expected — skill-b should see after substitution:
- FIRST = hello
- SECOND = world
5. Actual — no substitution occurs. The model sees the raw template and misinterprets the literal placeholder text:
- FIRST = $ARGUMENTS[1] (model reads the next line as the value)
- SECOND = (empty)
Because no substitution happened, the model confuses literal $ARGUMENTS[1] text on the next line as the value of FIRST, and SECOND ends up empty.
Notes
- Tested with both
claude-opus-4-6andclaude-sonnet-4-6— same behavior on both. - Removing
context: forkfrom skill-b fixes the issue immediately — same invocation correctly substitutes both arguments. context: subdialoghas the same problem.- Direct user invocation (
/skill-b hello world) substitutes correctly even withcontext: fork— the bug only occurs in the skill-a → skill-b chain.
Environment
- Claude Code CLI v2.1.74
- macOS Darwin 25.2.0
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗