OpenCode
Summary: OpenCode is an open-source coding-agent harness that connects models from supported providers to a software-development environment.
At a glance​
| Question | Answer |
|---|---|
| What is it? | An open-source coding-agent harness |
| Interfaces | Terminal, desktop app, and IDE extension |
| Models | Models exposed by supported providers |
| Project instructions | AGENTS.md |
| Main modes | Plan and Build |
| Extensions | MCP, commands, skills, and plugins |
What it provides​
- Repository and file context
- File reading and editing
- Terminal command execution
- Configurable model providers
- Project instructions through
AGENTS.md - Plan mode for investigation and design
- Build mode for implementation
- MCP servers and other extensions
How it works​
- The developer gives OpenCode a task.
- OpenCode gathers relevant project context.
- A configured model proposes an answer or tool action.
- OpenCode checks the configured permissions.
- OpenCode executes permitted actions.
- Tool results are returned to the model.
- The model continues, revises, or finishes the task.
OpenCode is the harness around the model. It provides the working environment, tools, permissions, and execution loop.
Model support​
OpenCode is not itself a language model. It can use models exposed by the providers supported by its configuration.
An API key alone is not sufficient. The provider integration, model identifier, capabilities, and account permissions must also be compatible with OpenCode.
Project instructions​
OpenCode can initialize a project with:
/init
This analyzes the project and creates an AGENTS.md file. The file gives OpenCode
persistent project context, such as:
- project structure;
- coding conventions;
- useful commands;
- testing expectations;
- repository constraints.
Plan and Build modes​
| Mode | Purpose |
|---|---|
| Plan | Explore the problem and propose an implementation |
| Build | Make changes and execute the implementation |
Plan mode is useful when the problem or implementation approach is not yet clear. Build mode is used after the approach is understood and the changes should be made.
Remember​
- OpenCode is a harness, not a model.
- It uses models exposed through supported provider integrations.
AGENTS.mdsupplies project-specific instructions.- Plan mode separates investigation from implementation.
- Build mode performs the implementation.