Meta-skill: how to pass skills/context to Claude sub-agents that start with fresh context, with documented SDK gotchas.
94
94%
Does it follow best practices?
Impact
96%
1.50xAverage score across 3 eval scenarios
Passed
No known issues
Sub-agents do not inherit the orchestrator's skills, history, or accumulated state on ANY platform. They start with a blank slate. The core problem is the same whether you're on Claude Code or GitHub Copilot: delegation is a context-loss event unless you explicitly propagate what the sub-agent needs.
What Claude sub-agents DO inherit:
CLAUDE.md contentWhat they do NOT inherit:
AgentDefinition)Agent SDK (AgentDefinition)
AgentDefinition(skills=["govee-h6056", "face-recognition-calibration"])agent = AgentDefinition(
model="claude-opus-4-5",
skills=["govee-h6056", "face-recognition-calibration"],
system_prompt="You are a lighting-control specialist.",
)
result = agent.run(task_prompt)Claude Code Task tool
.claude/skills/ technically works but is undocumented
(GH #32910) — do not rely on it.Copilot in VS Code (agent mode) maintains conversation context within a single session — unlike Claude Code sub-agents which start fresh per spawn. But the context-loss problem still exists at the tool/subprocess boundary.
What VS Code Copilot agent mode HAS in context:
.github/copilot-instructions.md (workspace-level, like CLAUDE.md)#file, #selection referencesWhat it LOSES when delegating:
@workspace, @terminal,
custom @participant), each participant has its own system prompt and gets
only the routed message + explicit context references, NOT the accumulated
conversation..github/copilot-instructions.md (workspace-level ground truth)
CLAUDE.md. Every Copilot interaction in the workspace sees it.#file references in chat
#file:.tessl/tiles/jbaruch/govee-h6056/skills/govee-h6056-control/SKILL.mdAgentDefinition(skills=[...]).Custom instructions in VS Code settings
github.copilot.chat.codeGeneration.instructions — persistent per-workspace.#file references.| Concern | Claude Code | VS Code Copilot |
|---|---|---|
| Workspace-level shared context | CLAUDE.md | .github/copilot-instructions.md |
| Per-request skill injection | AgentDefinition(skills=[...]) | #file:path/to/SKILL.md in chat |
| Always-on rules | CLAUDE.md rules | copilot-instructions.md + VS Code settings |
| Subprocess context | Sub-agents start FRESH | Terminal commands are bare processes |
| Validation handshake | Echo-skills protocol (below) | Same pattern — add to instructions |
Every sub-agent's first action must be to echo back the skill names it received. The orchestrator verifies the echo matches the expected set. If it doesn't, fail loudly rather than letting the sub-agent operate with missing context.
Minimal echo handler (inline in the sub-agent preamble or in scripts/echo_skills.py):
import json, sys
def echo_skills(received: list[str], expected: list[str]) -> None:
missing = set(expected) - set(received)
extra = set(received) - set(expected)
if missing or extra:
raise RuntimeError(
f"Skill handoff mismatch — missing: {missing}, unexpected: {extra}"
)
print(json.dumps({"skills_echo": received}), flush=True)
echo_skills(
received=["govee-h6056", "face-recognition-calibration"],
expected=["govee-h6056", "face-recognition-calibration"],
)The orchestrator parses the skills_echo JSON line from the sub-agent's first
output and aborts the run if the lists don't match.
If a piece of information must reach every sub-agent, put it in CLAUDE.md.
Skills are opt-in per sub-agent and will otherwise silently not apply.
context: fork is semantically inverted — it creates an ISOLATED blank context,
not a fork of the parent. → GH #20492For additional known issues (silent model switching, AskUserQuestion unavailability, billing routing, filesystem skill discovery), see ../../docs/SUB_AGENT_ISSUES.md.
AgentDefinition(skills=[...]) if you're on the SDK. Otherwise, inline the
skill bodies into the prompt string.CLAUDE.md — do not rely on
implicit inheritance.See the rule sub-agent-delegation-rules for a quick reminder card.