SOP 007: Run Skills in a Subagent
Fresh| Field | Value |
|---|---|
| SOP ID | 007 |
| Version | 1.0 |
| Status | Active |
| Last Updated | 2026-02-14 |
Purpose
Execute skills in isolated forked contexts using context: fork, keeping them separate from your main conversation.
Architecture
Skills vs Subagents
| Approach | System Prompt | Task | Also Loads |
|---|---|---|---|
Skill with context: fork | From agent type (Explore, Plan, etc.) | SKILL.md content | CLAUDE.md |
Subagent with skills field | Subagent's markdown body | Claude's delegation message | Preloaded skills + CLAUDE.md |
Procedure
Step 1: Add context: fork
yaml
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file referencesStep 2: Choose an Agent Type
| Agent | Best For | Tools Available |
|---|---|---|
Explore | Read-only research, codebase exploration | Glob, Grep, Read (no writes) |
Plan | Architecture planning, design decisions | Read-only + planning output |
general-purpose | Full capability tasks | All tools |
Custom (.claude/agents/) | Specialized workflows | As configured |
Step 3: Understand Execution
When the skill runs:
- A new isolated context is created
- The subagent receives skill content as its prompt
- The
agentfield determines the execution environment - Results are summarized and returned to main conversation
context: fork only works with task content
If your skill contains guidelines without a task, the subagent receives guidelines but no actionable prompt, and returns without meaningful output.
Step 4: Example - PR Summary Skill
yaml
---
name: pr-summary
description: Summarize changes in a pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`
## Your task
Summarize this pull request:
- What changed and why
- Key files modified
- Potential risks or concernsVerification Checklist
- [ ]
context: forkis set in frontmatter - [ ]
agentfield matches the intended execution environment - [ ] Skill content contains actionable task instructions
- [ ]
allowed-toolsgrants necessary permissions - [ ] Results return correctly to main conversation