What this thread does
Do first: Create .opencode/agents/explainer.md with a purpose description and mode: subagent, then ask the primary agent to use the explainer subagent.
Short answer
As of November 2026, OpenCode V2 gives subagents fresh child-session context and runs them in the background. The primary agent receives reports when the child goes idle and after later work.
What to do
A minimal project profile (put task instructions after the closing delimiter):
---
description: Explains code without changing it
mode: subagent
---
| Field / choice | Concrete behavior |
|---|---|
| Project file | .opencode/agents/<name>.md; nested .opencode/agents/team/reviewer.md has ID team/reviewer |
| Discovery | Project .opencode directories from current directory up to project root |
description | Purpose supplied to the model selecting a specialist |
mode | primary default for new custom agents; subagent child only; all either |
| Prompt | Markdown body; JSON uses system, replacing the provider base prompt while project instructions still apply |
| JSON alternative | agents entries in opencode.jsonc |
model | provider/model or provider/model#variant; omitted child model inherits parent; expanded JSON accepts providerID, model, variant |
permissions | Ordered action, resource, effect rules; effects allow, ask, deny; last matching rule wins |
| Read-only example | Deny edit and shell actions for resource *; these cover file changes and shell commands |
| Delegation | Parent subagent permissions determine which child IDs it can launch; child uses its own permissions |
steps | Positive model-step maximum; steps: 8 is the page’s example; final step removes tools for a text report; new input resets allowance |
hidden: true | Removes listings, interactive discovery and subagent catalog; visibility control only |
disabled: true | Removes an agent during configuration loading |
Ask the primary agent to use the profile by name, as the page does for its reviewer example. Definitions merge in load order: later scalar values replace, request maps merge, and permission rules append. Global permissions precede agent rules, so place broad rules before narrower exceptions.
Limits and open questions
Omitting mode does not create a child-only specialist. Built-in general handles multi-step work but cannot launch more subagents; explore searches and reads without editing. V2 has no built-in scout.
V1 top-level prompt, permission, maxSteps and disable are legacy; use V2 system, permissions, steps and disabled. Legacy temperature, top_p and tools also do not belong in new V2 definitions. request overlays are stored but currently not sent by the V2 session runner; configure active request options on a provider, model or variant instead. The page gives no release date.
Supported V1 files still load, but convert each profile’s frontmatter together: mixing V1 fields into a V2 file can ignore them with a warning. The legacy agent/, mode/ and modes/ directories remain discoverable alongside agents/; new profiles should use agents/.
Not for: OpenCode V1 agent configuration.
Sources
- OpenCode agents documentation, Anomaly.
- V1 migration: agent fields and files, Anomaly.
Checked
2026-11-16; read OpenCode agents documentation; V1 migration: agent fields and files; no command was run.
Started from a post by @OpenCode contributors, packaged by the editor. Original post