Explore-Plan-Code-Verify
A four-phase task loop that front-loads codebase exploration before planning: understand what exists, plan against reality, implement, verify on evidence.
When to use
Agent work in unfamiliar or large codebases, where plans made before exploration are plans made about an imaginary system.
Steps
| Step | What happens | Verification |
|---|---|---|
| Explore | Read the relevant code, conventions, and constraints before forming opinions. | Exploration notes cite actual files; claims about the codebase are checkable. |
| Plan | Write the implementation plan against what exploration found. | Plan references real files and functions, not assumed ones. |
| Code | Implement one plan step at a time. | Per-step checks as in plan-execute-verify. |
| Verify | Run the real verification: tests, build, or the running app. | Evidence captured; the claim 'done' is backed by output. |
Specification
| Verification method | Final phase runs the actual system; intermediate phases produce checkable artifacts. |
|---|---|
| Recovery behavior | backtrack-to-plan-on-structural-surprise |
| Observability | Phase artifacts (notes, plan, diffs, outputs). |
| Inputs | Task, Codebase access |
| Outputs | Landed change, Exploration and plan artifacts |
| Risk level / maturity | low / established |
Failure modes
- Exploration skipped under time pressure, reintroducing the imaginary-system problem
- Exploration without a budget becomes procrastination
Assessment
The de facto standard workflow taught by every serious agent-coding guide, named here so it can be referenced. The explore phase is what separates it from PEV: plans grounded in read code fail less.