subagentport

OpenCode subagents

Generate an OpenCode subagent as Markdown or opencode.json, with mode, model, temperature, steps and per-tool permissions.

Last checked against official docs: 2026-10-20. OpenCode agents, permissions, config.


  

Locations

Markdown: .opencode/agents/ or ~/.config/opencode/agents/. JSON: agent object in opencode.json.

Markdown vs JSON

Markdown uses the filename as the agent name (no name field). JSON uses the object key. The body is the prompt in Markdown; JSON uses prompt.

MCP tool naming uses patterns like mymcp_* in permissions (verify against your server names).

OpenCode rules document Claude CLAUDE.md compatibility only; .claude/agents/ is not listed for OpenCode.

FAQ

What is the difference between mode all and subagent?
mode selects primary, subagent or all. Primary agents are switched with Tab; subagents are delegated tasks. Other tools in this converter target subagent-style files with mode: subagent by default.
Is tools deprecated?
OpenCode docs mark the tools object as deprecated in favor of permission. Use permission keys with allow, ask or deny.
How do I stop an agent calling other subagents?
Set permission.task to deny to block subagent invocation per OpenCode permissions docs.
Where do Markdown agents live?
Project .opencode/agents/ and global ~/.config/opencode/agents/. JSON agents live under the agent key in opencode.json.
How do permissions merge?
Agent permissions merge with global config; agent rules win. Pattern objects use last matching rule wins.