Modes are now configured through the
agent option in the opencode config. The mode option is now deprecated. Learn more about agents.Built-in Modes
OpenCode comes with two built-in modes.Build
Build is the default mode with all tools enabled. This is the standard mode for development work where you need full access to file operations and system commands.Plan
A restricted mode designed for planning and analysis. In plan mode, the following tools are disabled by default:write- Cannot create new filesedit- Cannot modify existing files (except for files located at.opencode/plans/*.mdto detail the plan itself)patch- Cannot apply patchesbash- Cannot execute shell commands
Switching Modes
You can switch between modes during a session using the Tab key, or your configuredswitch_mode keybind.
Configuration
You can customize the built-in modes or create your own through configuration. Modes can be configured in two ways:JSON Configuration
Configure modes in youropencode.json config file:
opencode.json
Markdown Configuration
You can also define modes using markdown files. Place them in:- Global:
~/.config/opencode/modes/ - Project:
.opencode/modes/
~/.config/opencode/modes/review.md
review.md creates a review mode).
Configuration Options
Model
Override the default model for this mode. Useful for using different models optimized for different tasks.opencode.json
Temperature
Control the randomness and creativity of the AI’s responses. Lower values make responses more focused and deterministic, while higher values increase creativity and variability.opencode.json
- 0.0-0.2: Very focused and deterministic responses, ideal for code analysis and planning
- 0.3-0.5: Balanced responses with some creativity, good for general development tasks
- 0.6-1.0: More creative and varied responses, useful for brainstorming and exploration
Prompt
Specify a custom system prompt file for this mode.opencode.json
Tools
Control which tools are available in this mode.opencode.json
Available Tools
Here are all the tools that can be controlled through the mode config:| Tool | Description |
|---|---|
bash | Execute shell commands |
edit | Modify existing files |
write | Create new files |
read | Read file contents |
grep | Search file contents |
glob | Find files by pattern |
list | List directory contents |
patch | Apply patches to files |
todowrite | Manage todo lists |
todoread | Read todo lists |
webfetch | Fetch web content |
Custom Modes
You can create your own custom modes by adding them to the configuration.Using JSON Configuration
opencode.json
Using Markdown Files
Create mode files in.opencode/modes/ for project-specific modes or ~/.config/opencode/modes/ for global modes:
.opencode/modes/debug.md
Use Cases
Here are some common use cases for different modes:- Build mode: Full development work with all tools enabled
- Plan mode: Analysis and planning without making changes
- Review mode: Code review with read-only access plus documentation tools
- Debug mode: Focused on investigation with bash and read tools enabled
- Docs mode: Documentation writing with file operations but no system commands
Migration to Agents
The
mode configuration is deprecated in favor of the more flexible agent configuration. Please refer to the agents documentation for the current approach.Before (modes)
After (agents)