Session 2
Plan before you build: the two agent modes
Goal. Use 'plan' mode to have the agent analyse and propose an approach before it touches a single file — then switch to 'build' to execute.
▶ Try this prompt
Explain how authentication flows through this codebase and outline the safest way to add password reset — don't change any files yet.
Start in plan mode for this. Press Tab to toggle to build mode once you're happy with the plan.
- 1opencode has two built-in agent modes you toggle with Tab. plan is read-only analysis — it explores and explains without modifying files, and any bash execution is permission-gated.
- 2build mode makes the actual code changes. The status bar (bottom of the TUI) shows which mode you're in, so you always know whether the agent can write.
- 3Read the plan, push back or refine it in plain language, and only then switch to build — a quick way to avoid surprise edits on unfamiliar code.
You'll see. A read-only walkthrough of the codebase and a proposed approach in plan mode, then real edits once you toggle to build.
Cost. Both modes use your model's tokens like any other turn — but planning first usually saves money by avoiding wrong edits you'd have to undo.
Takeaway. Think before you act: plan mode reads and proposes safely, build mode executes — one Tab apart.