$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

  1. 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`
  1. Invoke: /test-fork-args hello
  1. 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-purpose and agent: helper — same result.
  • The argument-hint frontmatter field is present and correctly defined.
  • Multiple skills in the same project using disable-model-invocation: true with $0 work as expected, confirming the syntax is correct.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗