feat: context: fork in skill frontmatter doesn't work - skill still runs inline
Resolved 💬 19 comments Opened Jan 8, 2026 by avxkim Closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
Description
The context: fork feature added in v2.1.0 doesn't appear to work. Skills with context: fork in frontmatter still run inline instead of in a forked sub-agent context.
Environment
- Claude Code version: 2.1.1
- OS: macOS (Darwin 25.1.0)
- Installation: Plugin marketplace
Steps to Reproduce
- Create a skill with
context: forkin frontmatter:
---
name: youtube-summary
description: Fetch YouTube video transcripts for summarization
allowed-tools: Bash, Read, BashOutput
context: fork
agent: Explore
---
# YouTube Summary Skill
...
- Clear plugin cache:
rm -rf ~/.claude/plugins/cache/... - Restart Claude Code
- Invoke the skill
Expected Behavior
Skill should run in a forked sub-agent context with its own conversation history, as documented:
- https://code.claude.com/docs/en/skills (mentions
context: forkfield) - CHANGELOG 2.1.0: "Added support for running skills and slash commands in a forked sub-agent context using
context: forkin skill frontmatter"
Actual Behavior
Skill runs inline in the main conversation context. The skill content is expanded/inlined directly into the conversation instead of being delegated to a sub-agent.
Additional Context
Tested with both:
agent: Exploreagent: general-purpose
Neither configuration resulted in forked execution.
19 Comments
I interpreted this: CHANGELOG 2.1.0: "Added support for running skills and slash commands in a forked sub-agent context using context: fork in skill frontmatter"
to mean that context: fork is to run the skill using subagent context, part of their subagent skill changes.
I have tested and validated that context: fork does use the subagent context.
How have you tested? In my understanding, a skill with
context: forkandagent, should be called with sub-agent, but instead it just calls inline a skill<p><strong>Status: WORKING</strong></p>
<h3 id="purpose" class="atx">Purpose</h3>
<p>Limits which skills an agent can see and execute. Essential for reducing context or tool bloat when you have many subagents and skills.</p>
<h3 id="syntax" class="atx">Syntax</h3>
<pre><code class="fenced-code-block language-yaml">---
name: agent-one
description: Agent with access to skill-alpha only
tools: Read, Glob
model: haiku
skills: skill-alpha
---</code></pre>
<h3 id="test-results" class="atx">Test Results</h3>
Agent | Skills Declared | Can Execute | Cannot Execute
-- | -- | -- | --
agent-one | skill-alpha | /skill-alpha | /skill-beta
agent-two | skill-beta | /skill-beta | /skill-alpha
<h3 id="test-results-1" class="atx">Test Results</h3>
<h4 id="test-a-agent-field-alone-no-context-fork" class="atx">Test A: <code>agent</code> field alone (NO <code>context: fork</code>)</h4>
<ul>
<li>Skill loaded in main conversation context</li>
<li><strong>Full main conversation tools available</strong></li>
<li>Did NOT spawn the specified agent</li>
<li><strong>Result: Does NOT work as expected</strong></li>
</ul>
<h4 id="test-b-agent--context-fork" class="atx">Test B: <code>agent</code> + <code>context: fork</code></h4>
<ul>
<li>Skill executed in <strong>forked sub-agent context</strong></li>
<li><strong>Only the specified agent's tools available</strong></li>
<li>Confirmed running in agent's context</li>
<li><strong>Result: WORKING</strong></li>
</ul>
Lots of changes without clear documentation, so I smoke tested skills and hooks this morning.
<h4 id="test-c-context-fork-alone-no-agent-field" class="atx">Test C: <code>context: fork</code> alone (NO <code>agent</code> field)</h4>
<ul>
<li>Skill executed in <strong>forked context</strong></li>
<li>Broad set of default tools available</li>
<li>Isolated execution, but not bound to specific agent</li>
<li><strong>Result: WORKING</strong> (for isolation without agent binding)</li>
</ul>
<h3 id="why-this-matters" class="atx">Why This Matters</h3>
<ul>
<li><strong>Security</strong>: Restrict skill execution to specific tools</li>
<li><strong>Isolation</strong>: Fork prevents skill from accessing main conversation state</li>
<li><strong>Specialization</strong>: Skills inherit agent configuration (tools, model, etc.)</li>
</ul>
<hr>
<h2 id="feature-3-skill-context-field" class="atx">Feature 3: Skill <code>context</code> Field</h2>
<p><strong>Status: WORKING</strong></p>
<h3 id="syntax-2" class="atx">Syntax</h3>
<pre><code class="fenced-code-block language-yaml">---
name: isolated-skill
context: fork
---</code></pre>
<h3 id="purpose-1" class="atx">Purpose</h3>
<p>The <code>context: fork</code> field runs the skill in an isolated sub-agent context. Combined with <code>agent</code>, it determines which agent configuration to use.</p>
<h3 id="values" class="atx">Values</h3>
<ul>
<li><code>fork</code> - Run in forked sub-agent context (confirmed working)</li>
<li>(Other values not tested)</li>
</ul>
How have you confirmed that it's working? Is the expected behaviour to see the agent spawn a subagent or does it show in main agents conversation but it's still in the subagents context window?
---------------
NOT WORKING example:
claude --version
2.1.3 (Claude Code)
"name: sync
description: USE THIS SKILL when setting up AI-readable documentation for a codebase, documenting conventions for consistent AI contributions, creating task-specific context chunks, updating documentation as codebase evolves, migrating from flat to hierarchical structure, or applying targeted patches to existing documentation
agent: Explore
context: fork
user-invocable: true"
invoked using "/sync"
the feature is not working in
2.1.5as wellFor plugins it is still not working in 2.1.12 (current latest).
However, on 2.1.2 (current stable), and probably since 2.1.0, it was already working for skills/commands and agents in my user's .claude folder
Perhaps that would explain why some of you reporting it IS working and some of you are reporting it IS NOT working.
Additional Reproduction Case: Plugin Skills with
context: forkDO NOT WORKEnvironment:
2.1.16claude --plugin-dir /path/to/pluginSetup:
I have a test plugin (
agent-patterns) specifically designed to verify orchestration patterns. The plugin contains skills withcontext: forkand differentagent:types.Skill Definition (
plugins/agent-patterns/skills/forked-alpha/SKILL.md):Similar skills exist for
forked-beta(agent: Plan) andforked-gamma(agent: general-purpose).Orchestration Command (
plugins/agent-patterns/commands/forked.md):The plugin includes a command that orchestrates the forked skills:
When I run
/agent-patterns:forked, this command instructs Claude to invoke all 3 skills in parallel.Test Procedure:
/agent-patterns:forkedwhich triggers the orchestration command/tmp/forked/{worker}-{timestamp}.mdExpected Behavior:
Actual Behavior:
| Worker | Start | End |
|--------|-------|-----|
| alpha | 21:16:31 | 21:16:37 |
| beta | 21:16:38 | 21:16:44 |
| gamma | 21:16:46 | 21:16:51 |
Each worker started only after the previous one finished, proving sequential execution.
Evidence:
The output files correctly record
Agent Type: Explore/Plan/general-purposefrom the script parameters, but execution was clearly sequential (each started after the previous finished), indicating thecontext: forkmechanism never triggered and no subagents were spawned.Impact:
This blocks the ability to create distributable plugins that leverage
context: forkfor parallel subagent execution - a key use case for plugin ecosystems. Plugin authors cannot usecontext: forkto isolate skill execution or run skills in specific agent contexts.Workaround Attempted:
Using the Task tool directly with custom sub agents works correctly and achieves true parallel execution. However, this defeats the purpose of
context: forkas a simpler mechanism for skill isolation.Confirming the issue: skill with
context: forkruns in the main context when loaded from a plugin.Also confirming the workaround: copying the skill to the local
.claude/skills/folder makes it work correctly in a subagent.
Claude Code version: 2.1.30
Platform: Windows
I can confirm this behavior, and would appreciate a fix. (Happy to share my test setup upon request, but others already shared are more thorough than mine.)
One reason I'd love to build my plugin with
context: forkskills (rather than explicit agents), is that agent instructions do not get dynamic context injected. (They probably should, but that's a separate issue.)Still broken on Feb 6 (v2.1.31).
context: forkworks in~/.claude/skills/but not from plugins. We're trying to distribute skills across our team via a private plugin, but everyone has to manually copy files to make it work. That defeats the point.The docs recommend plugins for sharing skills. The main feature doesn't work there. Please fix.
Did same test as @abhinavos7a. Still an issue in
2.1.32.I am still seeing the same in
2.1.71.Also facing this for skills installed from plugins in 2.1.72
I'm so confused. Someone on the Claude Code team tweeted about the
context: forkfeature despite this not working for us?https://x.com/lydiahallie/status/2033603164398883042
This issue is also reproduced in version 2.1.80.
Ironically, if you remove
context: forkclaude allows you to run the task in the background withcontrol + b. If you try that hotkey with the frontmatter included it won't let you delegate to the backgroundI want to use
context: forkbecause I want this skills to be invoked from within another skill that I call directly. I'm intentionally designing my skill calls to control what context skills see. In some cases, I want a clean context always for that skill to run in, and therefore wantcontext: fork.My workaround today is to tell the _calling_ skill to dispatch to
Agent(....., <skillname>). Does ctrl+b (backgrounding) actually restart the skill in a clean context? That would seem strange.This was fixed in v2.1.101 — Plugin-loaded skills now honor the
context: forkandagentfrontmatter fields, matching the behavior of user/project skills. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.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.