Agents & Permissions
OpenCode agents are not just different prompts—they are full configs with mode, model, and permission.
Built-in Agents
Build (Primary)
- Default main agent, full tools
- For: features, tests, multi-file edits
Plan (Primary)
- Restricted agent: sensitive ops like
edit,bashdefault toaskor deny - For: design, review suggestions, refactor plans
- No surprise diffs—OpenCode’s “safe design mode”
Explore (Subagent)
- Read-only, fast glob/grep/read
- For: “Where is this module?” “What API routes exist?”
Scout (Subagent)
- Read-only, focused on external deps and upstream source
- For: third-party libs, cloned dependency cache
General (Subagent)
- Full tools (except todo limits), can edit files
- For: parallel independent subtasks
Switching and Invocation
Hidden agents (hidden: true) do not appear in @ menu but can still be invoked via task.
JSON Agent Config
opencode.json:
Markdown Agent Config
Paths:
- Global:
~/.config/opencode/agents/review.md - Project:
.opencode/agents/review.md
File review.md → agent name review.
Interactive Create
Wizard asks location, description, permission checkboxes, and writes a Markdown agent file.
Permission Advanced
Global default + agent override
task permission (who can call which subagent)
With deny, that subagent is removed from task tool descriptions; users can still @ invoke manually.
steps limit (cost control)
At the step cap, the agent must summarize instead of calling more tools.