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

Resolved 💬 5 comments Opened Mar 16, 2026 by vignesh-sriram Closed Apr 18, 2026

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 ↗

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