Plugin skill `context: fork` + `agent:` frontmatter not honored in 2.1.112 — runs inline instead of dispatching to subagent
Summary
Per the skills docs, a plugin skill with context: fork + agent: <name> frontmatter should dispatch to the named subagent when invoked. In Claude Code 2.1.112, this is not honored — the skill runs inline in the main conversation instead of forking.
Environment
- Claude Code: 2.1.112
- Plugin:
macroscope@macroscope-local(local directory marketplace) - OS: macOS 14 (Darwin 23.6.0)
Minimal repro
Plugin layout:
~/.claude/plugins/cache/macroscope-local/macroscope/1.4.3/
├── .claude-plugin/plugin.json (name: macroscope, version: 1.4.3)
├── skills/macroscope/SKILL.md
└── agents/macroscope-review-worker.md
SKILL.md frontmatter (canonical per docs):
---
name: macroscope
description: Run code review on this branch.
argument-hint: [loop]
context: fork
agent: macroscope-review-worker
---
Run Macroscope for the current branch.
Agent frontmatter:
---
name: macroscope-review-worker
description: Run the local Macroscope review in a background worker.
model: inherit
background: true
tools: ["Bash", "Read", "Edit", "Write", "Grep", "Glob"]
---
Steps:
- Install plugin, enable via
claude plugins enable. - Open a fresh Claude Code session:
claudein any directory. - Type
/macroscope.
Expected: Main conversation dispatches to macroscope-review-worker subagent (visible via "subagent_type":"macroscope:macroscope-review-worker" in session transcript).
Actual: Skill content is loaded inline in the main conversation. No Task/Agent tool call with subagent_type is made. The model interprets the skill body and runs the review inline, blocking the main conversation.
Verification
Session transcript grep for subagent_type:
$ grep -o '"subagent_type":"[^"]*"' ~/.claude/projects/<cwd>/<session>.jsonl
(no output — zero dispatches)
Tested in 3 completely fresh Claude Code sessions across different clean working directories (no repo-level skill shadowing). All 3 ran inline.
Expected behavior
Per the skills docs:
context: fork— Run in a forked subagent context.agent— Which subagent type to use whencontext: forkis set.
A user typing /macroscope (or the model auto-invoking the skill) should result in Claude Code's harness dispatching the skill execution to the named subagent, not inlining the skill body into the main conversation.
Workaround
Adding explicit "Use the Task tool to launch the subagent" instructions in the skill body works, because the model then performs the dispatch itself. But this is verbose and defeats the purpose of having context: fork as a declarative contract.
Impact
Any plugin relying on context: fork to isolate long-running or resource-intensive workflows into subagents is silently falling back to inline execution, blocking the main conversation and consuming its context window.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗