Skip to main content

OpenCode

Summary: OpenCode is an open-source coding-agent harness that connects models from supported providers to a software-development environment.

At a glance​

QuestionAnswer
What is it?An open-source coding-agent harness
InterfacesTerminal, desktop app, and IDE extension
ModelsModels exposed by supported providers
Project instructionsAGENTS.md
Main modesPlan and Build
ExtensionsMCP, 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​

  1. The developer gives OpenCode a task.
  2. OpenCode gathers relevant project context.
  3. A configured model proposes an answer or tool action.
  4. OpenCode checks the configured permissions.
  5. OpenCode executes permitted actions.
  6. Tool results are returned to the model.
  7. 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​

ModePurpose
PlanExplore the problem and propose an implementation
BuildMake 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.md supplies project-specific instructions.
  • Plan mode separates investigation from implementation.
  • Build mode performs the implementation.

Sources​