context: fork and agent frontmatter silently ignored for plugin-loaded skills

Status Fixed / completed
Reported on v2.1.76
Maintainer reply ✓ Yes — ashwin-ant
Activity 5 comments · opened Mar 16, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Summary

When a skill with context: fork and agent: Explore frontmatter is loaded via a plugin (--plugin-dir or installed plugin), the fork/agent fields are silently ignored. The skill body is injected inline as a synthetic user message instead of being dispatched to a subagent. The identical skill works correctly when placed in .claude/skills/.

This is a blocker for teams distributing forked skills via plugins.

Reproduction

SKILL.md (identical file used in both tests):

---
name: fork-test
description: Use this skill when the user says "test fork".
context: fork
agent: Explore
---

# Fork Test

1. Write a file at `fork-test-output.txt` containing "FORK_DETECTED: true"
2. Run: `echo "FORK_PID: $$"`
3. Output: "FORK_TEST_COMPLETE"

Test 1 — Local skill (works)

mkdir -p /tmp/test-project/.claude/skills/fork-test/
cp SKILL.md /tmp/test-project/.claude/skills/fork-test/SKILL.md
cd /tmp/test-project && claude -p "test fork" --output-format json

Test 2 — Plugin skill (broken)

cd /tmp/test-project && claude -p "test fork" --plugin-dir /path/to/plugin --output-format json

Evidence from JSON output

| Field | Local skill | Plugin skill |
|---|---|---|
| tool_use_result.status | "forked" | missing |
| tool_use_result.agentId | "a02a93032c8fcc105" | missing |
| tool_use_result.result | Summary from subagent | missing |
| isSynthetic user message | Not present | true (skill body injected inline) |
| Models used | Opus + Haiku (Explore agent) | Opus only (no subagent) |

Local skill tool_use_result (correct)

{
  "success": true,
  "commandName": "fork-test",
  "status": "forked",
  "agentId": "a02a93032c8fcc105",
  "result": "**Summary**: I am operating in read-only mode..."
}

Plugin skill tool_use_result (broken)

{
  "success": true,
  "commandName": "plato-ai-jetpack:fork-test"
}

No status, no agentId, no result. The skill body appears as a synthetic user message (isSynthetic: true) and executes inline in the main conversation.

Expected behavior

Plugin skills with context: fork should be dispatched to a subagent, identical to local skills.

Actual behavior

The context and agent frontmatter fields are silently stripped/ignored. No warning or error is emitted. The skill runs inline.

Impact

Teams cannot distribute skills that use context: fork via plugins. This defeats the purpose of plugins for any skill that needs subagent isolation (research tasks, long-running operations, context window protection). There is no workaround other than asking every team member to manually copy skills into .claude/skills/.

Environment

  • Claude Code: 2.1.76
  • Platform: macOS (Darwin 25.3.0)
  • Feedback ID: e039757e-bc04-48cc-b81e-3cd78dfc9f98

View original on GitHub ↗

5 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16803
  2. https://github.com/anthropics/claude-code/issues/18226
  3. https://github.com/anthropics/claude-code/issues/34328

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

vignesh-sriram · 5 months ago

This needs to be fixed for teams as well as plugin developers to actually benefit from claude's features without too much workarounds.

rromanchuk · 4 months ago

one thing i just discovered, but still have to verify. In a plugin context, once i namespaced my custom agent, it started actually dispatching the context isolated, backgrounded, sub-agent. The skill and agent bar-agent live under the same plugin foo-plugin namespace

context: fork
agent: foo-plugin:bar-agent

I wonder if there is still a prefix for native agents from a plugin context

ashwin-ant collaborator · 4 months ago

This was fixed in v2.1.101 — Plugin-loaded skills now honor the context: fork and agent frontmatter fields instead of silently ignoring them. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.