claude-code - 💡(How to fix) Fix Feature request: skill frontmatter option to fork with full main-conversation context (like /fork) [1 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#55097Fetched 2026-05-01 05:46:18
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Add a new skill frontmatter option (e.g. context: inherit — naming TBD) that runs the skill in a side conversation with the main conversation's full context inherited, equivalent to invoking /fork at the moment the skill triggers. Today there is no skill-declarable way to get this behavior; users have to manually run /fork themselves.

Root Cause

Add a new skill frontmatter option (e.g. context: inherit — naming TBD) that runs the skill in a side conversation with the main conversation's full context inherited, equivalent to invoking /fork at the moment the skill triggers. Today there is no skill-declarable way to get this behavior; users have to manually run /fork themselves.

Fix Action

Fix / Workaround

  1. Custom subagent + bundled skill + bundled MCP — superficially the obvious workaround if clean-context isolation were acceptable: define a docx-writing subagent that preloads the skill via skills: [...] and bundles the MCP tools. In practice it breaks down on a routing problem that I do not think has a clean solution today:
  • To make the subagent useful, its description has to describe the user-facing capability ("write a docx based on the current discussion").
    • But the skill's description describes the same capability — that is what makes the skill matchable in the first place.
    • With both visible to the routing model, selection between "invoke the skill directly" and "delegate to the subagent" is genuinely ambiguous, and in practice the model picks inconsistently.
    • The intended way out is disable-model-invocation: true on the skill so the skill is only reachable through the subagent's preload — that hides the skill from main-session routing entirely and leaves the subagent's description as the only matchable surface. That is exactly the path #51007 reports as broken: the same flag also disables the subagent's own skills: preload, so the subagent ends up loaded without the skill body it was supposed to bundle. With true unusable, the skill has to stay invocable from the main session.
    • The only configuration that "works" today is genuinely silly: leave disable-model-invocation at its default (false), put "NEVER trigger this skill" into the skill's description to deter the main-session model from picking it, and duplicate the real triggering description onto the subagent. The skill stays technically visible to the main session — the whole arrangement is held together by a description that says "ignore me." That is not a workaround, it is a symptom that the feature surface is missing a primitive.

Code Example

context: inherit   # or: fork-with-history, fork-inherit, etc.
RAW_BUFFERClick to expand / collapse

Summary

Add a new skill frontmatter option (e.g. context: inherit — naming TBD) that runs the skill in a side conversation with the main conversation's full context inherited, equivalent to invoking /fork at the moment the skill triggers. Today there is no skill-declarable way to get this behavior; users have to manually run /fork themselves.

Real use case

I have a docx-writing skill. During execution it makes heavy MCP / CLI calls (doc-platform MCP for doc creation, file searches, etc.). What I want:

  • The skill needs full main-conversation history — it's writing a doc about what we have been discussing, so a clean context is useless.
  • The skill's tool-call noise (MCP traffic, intermediate file reads) should not pollute the main conversation context.

/fork is exactly this shape — but it can only be triggered manually by the user, not declared by a skill.

Why the existing options don't cover this

Claude Code currently offers three nearby mechanisms, none of which fit:

  1. Skill context: fork — spawns a completely clean-context subagent. Great for independent tasks like code review, wrong fit when the skill needs to know what the main conversation has been about.

  2. /fork slash command — has the right semantics (inherit full context, isolate execution) but is user-triggered only; a skill cannot declare it.

  3. Custom subagent + bundled skill + bundled MCP — superficially the obvious workaround if clean-context isolation were acceptable: define a docx-writing subagent that preloads the skill via skills: [...] and bundles the MCP tools. In practice it breaks down on a routing problem that I do not think has a clean solution today:

    • To make the subagent useful, its description has to describe the user-facing capability ("write a docx based on the current discussion").
    • But the skill's description describes the same capability — that is what makes the skill matchable in the first place.
    • With both visible to the routing model, selection between "invoke the skill directly" and "delegate to the subagent" is genuinely ambiguous, and in practice the model picks inconsistently.
    • The intended way out is disable-model-invocation: true on the skill so the skill is only reachable through the subagent's preload — that hides the skill from main-session routing entirely and leaves the subagent's description as the only matchable surface. That is exactly the path #51007 reports as broken: the same flag also disables the subagent's own skills: preload, so the subagent ends up loaded without the skill body it was supposed to bundle. With true unusable, the skill has to stay invocable from the main session.
    • The only configuration that "works" today is genuinely silly: leave disable-model-invocation at its default (false), put "NEVER trigger this skill" into the skill's description to deter the main-session model from picking it, and duplicate the real triggering description onto the subagent. The skill stays technically visible to the main session — the whole arrangement is held together by a description that says "ignore me." That is not a workaround, it is a symptom that the feature surface is missing a primitive.

    And even if #51007 were fixed and the description-collision went away, this path still does not deliver the "needs main-conversation context" half of the requirement — custom subagents always start clean.

The result: the current matrix forces a choice between "inherit context" (only via manual /fork) and "isolate execution" (only via clean-context fork or subagent), with no way to get both from a skill declaration.

Proposal

Add a skill frontmatter value such as:

context: inherit   # or: fork-with-history, fork-inherit, etc.

Semantics:

  • When the skill triggers, behave as if the user just ran /fork: a side conversation is opened with the full main-conversation context.
  • The skill's instructions and all subsequent tool calls run inside that side conversation.
  • Final result returns to the main conversation; intermediate tool-call traces stay in the fork.

This rounds out the existing context: fork (clean) into a pair: clean fork for independent work, inherit fork for context-dependent isolated work. It also collapses the description-collision problem above — there is no longer a need to introduce a subagent purely as an isolation boundary, so the skill's description is the only routing surface and the routing decision is unambiguous.

Alternative considered

Fix the disable-model-invocation: true × subagent skills: [...] preload interaction (#51007), then document custom-subagent + bundled-MCP as the recommended isolation pattern. This would unblock the description-collision symptom (disable-model-invocation: true would actually work, hiding the skill from main-session routing and leaving the subagent's description as the only matchable surface). But it still does not solve the "needs main-conversation context" half, since custom subagents always start clean. So fixing #51007 is necessary for adjacent clean-context isolation use cases, but not sufficient for this one.

Why this matters now

This feature request and #51007 are independent asks that solve different halves of the matrix:

  • This feature is the only thing that unblocks the docx-writing use case above — declaring a skill that both inherits main-conversation context and isolates tool-call traffic in a single primitive. Without it, the only path is the user manually typing /fork before invoking the skill, which defeats the purpose of skills as declarative capabilities.
  • Fixing #51007 does not close that gap (custom subagents always start without main-session history), but it makes the orthogonal "clean-context isolation via subagent" path actually workable for adjacent scenarios — and removes the silly description-trick configuration described above.

Resolving both would give users a clean matrix to choose from: context: fork for clean-context isolated work, context: inherit for context-dependent isolated work, and a working subagent path for cases that genuinely want a separate-identity boundary.

Related

  • #51007 — disable-model-invocation: true blocks the documented subagent skills: preload, which is what makes the custom-subagent path collapse into the silly configuration described above.
  • #51165 — separate context: fork regression on Windows v2.1.113.

extent analysis

TL;DR

Add a new skill frontmatter option, such as context: inherit, to allow skills to run in a side conversation with the main conversation's full context inherited.

Guidance

  • Introduce a new frontmatter option, e.g., context: inherit, to enable skills to inherit the main conversation's context.
  • Update the skill execution logic to create a side conversation with the inherited context when the new option is specified.
  • Ensure that the skill's instructions and tool calls run within the side conversation, and the final result is returned to the main conversation.
  • Review and refine the custom subagent and bundled MCP approach to provide a clean-context isolation path for adjacent scenarios.

Example

context: inherit

This frontmatter option would enable the skill to inherit the main conversation's context and run in a side conversation.

Notes

The proposed solution aims to address the limitation of the current context: fork option, which starts a clean-context subagent. The new context: inherit option would provide a way for skills to access the main conversation's context while still isolating their execution.

Recommendation

Apply the proposed workaround by introducing the new context: inherit frontmatter option, as it addresses the specific use case of skills requiring main-conversation context while isolating their execution.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature request: skill frontmatter option to fork with full main-conversation context (like /fork) [1 participants]