Complete toolkit for configuring and extending OpenCode: agent creation, custom slash commands, configuration management, plugin development, and SDK usage.
98
98%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
Agent definitions are markdown files in:
.opencode/agents/<name>.md (project)~/.config/opencode/agents/<name>.md (global)---
# Core Configuration
model: "provider/model-id" # Model override
temperature: 0.7 # Sampling temperature
top_p: 0.9 # Nucleus sampling
prompt: "Custom system prompt" # Or use markdown body
description: "Agent description" # Shown in listings, triggers agent
mode: "subagent" | "primary" | "all" # Agent availability
color: "#FF5733" # UI color
maxSteps: 25 # Max tool call steps
disable: false # Disable agent
# Tool Access Control
tools:
edit: true
write: true
bash: true
read: true
glob: true
grep: true
webfetch: true
task: true
skill: true
# Permissions
permission:
edit: "ask" | "allow" | "deny"
bash:
"*": "allow"
"git *": "deny"
skill:
"*": "allow"
"my-skill": "deny"
webfetch: "ask" | "allow" | "deny"
doom_loop: "ask" | "allow" | "deny"
external_directory: "ask" | "allow" | "deny"
---| Mode | Description |
|---|---|
primary | User-selectable, can be default, spawns subagents |
subagent | Only callable via task tool by other agents |
all | Both primary and subagent (default) |
| Value | Behavior |
|---|---|
"allow" | Automatically permit |
"ask" | Prompt user for approval |
"deny" | Automatically reject |
editControls edit and write tools.
bashControls command execution. Supports wildcard patterns:
bash:
"*": "ask" # Ask for everything by default
"git *": "allow" # Allow all git commands
"npm *": "allow" # Allow npm commands
"rm *": "deny" # Block deletionskillControls skill access:
skill:
"*": "deny" # Deny all by default
"my-skill": "allow" # Allow specific skillwebfetchControls web fetching. "ask" prompts for each URL.
doom_loopControls doom loop detection (agent stuck in repetitive patterns).
external_directoryControls access to files outside working directory. Affects:
If not specified, agents inherit from global config:
permission:
edit: "allow"
bash: { "*": "allow" }
skill: { "*": "allow" }
webfetch: "allow"
doom_loop: "ask"
external_directory: "ask"| Tool | Purpose | Key Parameters |
|---|---|---|
read | Read file contents | filePath, offset, limit |
edit | String replacement in files | filePath, oldString, newString, replaceAll |
write | Create/overwrite files | filePath, content |
| Tool | Purpose | Key Parameters |
|---|---|---|
glob | Find files by pattern | pattern, path |
grep | Search file contents (regex) | pattern, path, include |
list | List directory contents | path |
| Tool | Purpose | Key Parameters |
|---|---|---|
bash | Execute shell commands | command, timeout, workdir, description |
Default timeout: 120000ms. Permissions: bash, external_directory.
| Tool | Purpose | Key Parameters |
|---|---|---|
webfetch | Fetch web content | url, format (text/markdown/html), timeout |
websearch | Web search via Exa AI | query, numResults |
codesearch | Code/SDK documentation search | query, tokensNum |
| Tool | Purpose | Key Parameters |
|---|---|---|
task | Launch subagents | description, prompt, subagent_type, session_id |
todowrite | Update todo list | todos array |
todoread | Read todo list | (none) |
| Tool | Purpose | Notes |
|---|---|---|
skill | Load skill instructions | Parameter: name |
batch | Parallel tool execution | Experimental: config.experimental.batch_tool |
lsp | Language Server Protocol | Experimental: OPENCODE_EXPERIMENTAL_LSP_TOOL |
Disable specific tools for an agent:
tools:
bash: false # No shell access
webfetch: false # No web access
task: false # Cannot spawn subagentsAll tools inherit from global config.tools by default.
---
description: Safe code reviewer.
mode: primary
permission:
edit: "ask"
bash: "deny"
external_directory: "deny"
---
You are a code review specialist...---
description: |-
Web research agent. Use when user says "research topic", "find info".
Examples:
- user: "research" -> search web
mode: subagent
permission:
skill:
"*": "deny"
"web-research": "allow"
---
You are a research specialist...---
description: Deployment helper.
permission:
skill:
"*": "deny"
"deploy-checklist": "allow"
---
You are a deployment specialist...