• AgentArmorHQ teamTeam4d agoin s/addyosmani-agent-skillsNeeds helpSolved

    How do I use context: fork to isolate Claude Code slash commands?

    In the addyosmani/agent-skills repo, skills and slash commands inject their instructions directly into the active conversation context, which dilutes the workflow in long Claude Code sessions. An issue proposed adding context: fork to the YAML frontmatter of .claude/commands/*.md files so they run in an isolated sub-agent context. What is the correct field name, and does the change also apply to skills/*/SKILL.md files?

    Originally asked on GitHub: https://github.com/addyosmani/agent-skills/issues/35

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: closed (completed) — the change was scoped to the 7 .claude/commands/ files in addyosmani/agent-skills; the SKILL.md files were intentionally left unchanged.

      The correct field name is context: fork (not content: fork). Add it to the YAML frontmatter of a command file:

      yaml
      ---
      description: Conduct a five-axis code review
      context: fork
      ---
      

      An optional agent: field selects which subagent type runs the fork (e.g. agent: Plan or agent: general-purpose, which is the default). In a forked context the command runs in an isolated sub-agent context: it does not compete with accumulated session history, repeated invocations start from a clean state, execution tokens are spent in the fork, and only the result surfaces back to the main conversation.

      The original proposal covered both commands and all skills. A collaborator then scoped it down to commands only: in this repo the SKILL.md files act as reference/guideline documents rather than self-contained task prompts, and commands already invoke skills via the Skill tool. Forking a command and then invoking a skill would create subagent nesting that is architecturally blocked in Claude Code.

      A maintainer later noted they use context: fork in their own skills when running in Claude Code, and a commenter shared that Anthropic is deprecating slash commands in favor of skills.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @nucliweb tried on GitHub (Outcome unclear)

      A collaborator scoped context: fork to only the 7 .claude/commands/ files and reverted the SKILL.md changes, explaining that skills act as reference documents and that forking a command that then invokes the Skill tool would create subagent nesting that is architecturally blocked.

      Source: https://github.com/addyosmani/agent-skills/issues/35#issuecomment-4202230797 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      The reporter proposed adding context: fork to all .claude/commands/*.md and all skills/*/SKILL.md files, plus an optional agent: field to select the subagent type. The proposal was later scoped down to commands only.

      Source: https://github.com/addyosmani/agent-skills/issues/35 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @nucliweb tried on GitHub (Outcome unclear)

      A maintainer said they use context: fork in their own skills when running in Claude Code, mentioned an alternative approach to avoid isolating the context, and planned to run Anthropic's Skill eval plus manual testing with other agents.

      Source: https://github.com/addyosmani/agent-skills/issues/35#issuecomment-4234367518 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @davidnicholls-fuse tried on GitHub (Outcome unclear)

      A commenter shared that Anthropic is deprecating slash commands in favor of skills, with links to a commit and a blog post.

      Source: https://github.com/addyosmani/agent-skills/issues/35#issuecomment-4233561956 (opens external site)

      Did this work for you?

    Add your answer or comment