claude-code - 💡(How to fix) Fix Plugin skill `context: fork` + `agent:` frontmatter not honored in 2.1.112 — runs inline instead of dispatching to subagent [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49559Fetched 2026-04-17 08:37:42
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

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.

Root Cause

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.

Fix Action

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.

Code Example

~/.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

---

---
name: macroscope
description: Run code review on this branch.
argument-hint: [loop]
context: fork
agent: macroscope-review-worker
---

Run Macroscope for the current branch.

---

---
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"]
---

---

$ grep -o '"subagent_type":"[^"]*"' ~/.claude/projects/<cwd>/<session>.jsonl
(no output — zero dispatches)
RAW_BUFFERClick to expand / collapse

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:

  1. Install plugin, enable via claude plugins enable.
  2. Open a fresh Claude Code session: claude in any directory.
  3. 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 when context: fork is 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.

extent analysis

TL;DR

The issue can be worked around by adding explicit instructions to launch the subagent using the Task tool in the skill body, but a more permanent fix would involve resolving the bug that prevents context: fork from dispatching to the named subagent.

Guidance

  • Verify that the context: fork and agent frontmatter in the skill are correctly formatted and match the expected syntax.
  • Check the plugin and Claude Code versions for any known issues or updates that may resolve the problem.
  • Test the skill with a different subagent to see if the issue is specific to the macroscope-review-worker agent.
  • Consider adding logging or debugging statements to the skill or agent to gain more insight into the dispatch process.

Example

---
name: macroscope
description: Run code review on this branch.
argument-hint: [loop]
context: fork
agent: macroscope-review-worker
---
Use the Task tool to launch the subagent: `Task: launch subagent macroscope-review-worker`

Notes

The provided workaround using the Task tool to launch the subagent is verbose and may not be suitable for all use cases. A more permanent fix would require resolving the underlying bug that prevents context: fork from dispatching to the named subagent.

Recommendation

Apply the workaround by adding explicit instructions to launch the subagent using the Task tool, as this is the most straightforward way to ensure the skill is executed in a forked subagent context until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Per the skills docs:

context: fork — Run in a forked subagent context. agent — Which subagent type to use when context: fork is 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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING