developing-subagents
Installation
SKILL.md
Developing Subagents
Subagents isolate verbose work from parent context, encode repeated workflows, and route narrower tasks to cheaper models. Prefer orchestration from the main conversation; nested delegation is platform-specific, harder to predict, and more expensive. Compose reusable workflow knowledge with Skills.
Platforms
- Claude Code —
.claude/agents/, frontmatter fields, permission modes, hooks, skills, memory, MCP scoping - OpenCode —
.opencode/agents/, primary/subagent modes, per-tool allow/ask/deny, cascade rules, JSON form - Codex —
.codex/agents/, TOML custom agents, explicit parallel spawning, inherited sandbox/config, global[agents]limits
When to make a subagent
- A workflow keeps repeating with the same instructions — encode it once.
- A task floods main context (large searches, log processing, full-file reads).
- The job needs a different system prompt, model, or permissions than the parent.
If a Skill carries the same instructions, prefer the Skill — Skills compose across agents and platforms.