Switch between the Build and Plan agents

agents & rules

// what it does

opencode ships two primary agents: Build (all tools enabled, the default) and Plan (edits and bash default to ask, so it analyzes and proposes without changing files). Press Tab to cycle, or set default_agent in config. Plan is the safe mode for exploring an unfamiliar codebase or reviewing a diff.

// shortcut

Tab
Shift+Tab

// shell

$ { "default_agent": "plan" }

// gotcha

Plan restricts via permissions, not a hard sandbox — approve an edit prompt and it still writes. For a truly hands-off run, set the agent's edit and bash permission to "deny".

// resources