Overview
Agents are specialized AI assistants for specific tasks. OpenCode supports two agent modes and multiple configuration formats.Agent Types
| Type | Description |
|---|---|
primary | Main agents you interact with directly (Tab to switch) |
subagent | Specialized assistants invoked by primary agents or via @mention |
Built-in Agents
| Agent | Mode | Description |
|---|---|---|
build | primary | Default agent with all tools enabled |
plan | primary | Analysis mode with edit/bash set to ask |
general | subagent | General-purpose research and multi-step tasks |
explore | subagent | Fast codebase exploration |
JSONC Configuration
Define agents inopencode.jsonc:
Markdown Configuration
Place files in~/.config/opencode/agents/ or .opencode/agents/:
~/.config/opencode/agents/review.md
Agent Options
| Option | Type | Description |
|---|---|---|
description | string | Required. Brief description of agent purpose |
mode | primary / subagent / all | Agent mode (default: all) |
model | string | Model override (provider/model-id) |
temperature | number | 0.0–1.0 (lower = more focused) |
steps | number | Max agentic iterations before forced response |
prompt | string | Custom system prompt (supports {file:path}) |
tools | object | Tool enable/disable map |
permission | object | Permission overrides |
disable | boolean | Disable the agent |
Temperature Guidelines
| Range | Use Case |
|---|---|
| 0.0–0.2 | Code analysis, planning (focused/deterministic) |
| 0.3–0.5 | General development (balanced) |
| 0.6–1.0 | Brainstorming, exploration (creative) |
Additional Model Options
Pass provider-specific options directly:See Also
- Permissions — Fine-grained per-agent access control.
- Skills & Instructions — Reusable instruction sets for agents.
- Configuration — Global configuration reference.