

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Agents
incomplete
2: Temperature
incomplete
3: Custom Agents
incomplete
4: Max Steps
incomplete
5: Subagents
incomplete
6: Task Permissions
incomplete
This lesson's interactive features are locked, please to keep using them
A custom agent can be defined easily with a Markdown file. And OpenCode watches for changes in its config directories, so if you update an agent's settings, it will normally reload without a restart.
Put the file in one of these locations:
.opencode/agents/ for a project-specific agent~/.config/opencode/agents/ for a global agentFor example, a file at .opencode/agents/review.md creates a review agent in the current project:
---
description: Reviews code for bugs, regressions, and risky changes
mode: primary
permissions:
- action: edit
resource: "*"
effect: deny
- action: shell
resource: "*"
effect: deny
---
You are a code review agent. Focus on:
- Finding bugs and edge cases
- Explaining tradeoffs clearly
- Suggesting changes without making direct edits
- Code quality and best practices
- Performance implications
- Security concerns
There are two parts to the file:
The frontmatter fields in this example are:
description: tells OpenCode and the model when this agent should be usedmode: whether it's a primary, subagent, or all agent (we'll talk about subagents soon)permissions: controls what the agent can do and which resources it can act onCreate a custom primary agent when you need separate permissions, tools, or subagent access. A custom agent is overkill when all you need is a different system prompt.
Create a read-only agent for reviewing Sloperator.
If the new agent doesn't appear, use the /reload command to reload your configuration without restarting OpenCode.
Tell OpenCode to run and submit the CLI tests from the project root.