$0 / $ARGUMENTS template variables not substituted in skills with context: fork
Resolved 💬 3 comments Opened Apr 16, 2026 by enprop Closed Apr 16, 2026
Version
Claude Code 2.1.110, macOS
Description
When a skill uses context: fork (with or without an agent field), the template variables $0, $ARGUMENTS, etc. are substituted with empty strings instead of the actual arguments passed by the user. The same $0 syntax works correctly in skills using disable-model-invocation: true.
Reproduction
- Create a skill with the following
SKILL.md:
---
name: test-fork-args
description: "Test argument passing in forked context"
argument-hint: <subcommand>
context: fork
---
# Test
Received subcommand: `$0`
All arguments: `$ARGUMENTS`
- Invoke:
/test-fork-args hello
- The forked agent receives:
Received subcommand: ``
All arguments: ``
Expected
$0 = hello, $ARGUMENTS = hello
Actual
Both $0 and $ARGUMENTS are empty strings. The forked agent has no access to the user's arguments.
Workaround
Skills using disable-model-invocation: true (inline mode) substitute $0 correctly. Removing context: fork resolves the issue but loses the isolated subagent behavior.
Notes
- Tested with both
agent: general-purposeandagent: helper— same result. - The
argument-hintfrontmatter field is present and correctly defined. - Multiple skills in the same project using
disable-model-invocation: truewith$0work as expected, confirming the syntax is correct.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗