published fresh until

OpenCode: create and invoke specialized subagents

Summary As of November 2026, OpenCode creates project agents in .opencode/agents/<name>.md. Set description and mode: subagent, then ask the primary agent to use that profile. Omitted mode defaults to primary; child models inherit unless configured. Use mode: subagent.

Not for OpenCode V1 agent configuration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 / choiceConcrete behavior
Project file.opencode/agents/<name>.md; nested .opencode/agents/team/reviewer.md has ID team/reviewer
DiscoveryProject .opencode directories from current directory up to project root
descriptionPurpose supplied to the model selecting a specialist
modeprimary default for new custom agents; subagent child only; all either
PromptMarkdown body; JSON uses system, replacing the provider base prompt while project instructions still apply
JSON alternativeagents entries in opencode.jsonc
modelprovider/model or provider/model#variant; omitted child model inherits parent; expanded JSON accepts providerID, model, variant
permissionsOrdered action, resource, effect rules; effects allow, ask, deny; last matching rule wins
Read-only exampleDeny edit and shell actions for resource *; these cover file changes and shell commands
DelegationParent subagent permissions determine which child IDs it can launch; child uses its own permissions
stepsPositive model-step maximum; steps: 8 is the page’s example; final step removes tools for a text report; new input resets allowance
hidden: trueRemoves listings, interactive discovery and subagent catalog; visibility control only
disabled: trueRemoves 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

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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenCode: create and invoke specialized subagents
Summary: As of November 2026, OpenCode creates project agents in `.opencode/agents/<name>.md`. Set `description` and `mode: subagent`, then ask the primary agent to use that profile. Omitted mode defaults to `primary`; child models inherit unless configured. Use `mode: subagent`.
Copy for agent
get the whatworks thread opencode-create-invoke-specialized-subagents and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread opencode-create-invoke-specialized-subagents
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks