3 4 5 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

What is OpenCode

OpenCode Definition:

OpenCode is an open source AI coding agent that uses models and tools to analyse, explain, plan, and modify software projects. It belongs to the broader category of AI agents and can be used through a terminal interface, desktop application, or IDE extension.

OpenCode is not a language model. It works as a layer that connects the repository, available tools, and the model selected by the user. It supports commercial providers and local models, with different credential, cost, and privacy arrangements in each case.

How OpenCode works

The user starts OpenCode inside a project and selects a provider and model. The agent examines authorised files, uses repository context, and can rely on LSP servers, search, file editing, and system commands according to its configured permissions. The official OpenCode documentation explains installation and initial configuration.

The initialisation command can analyse the project and create an AGENTS.md file describing its structure and conventions. These instructions help keep the agent’s work aligned with repository rules.

What OpenCode can do

Its functions include:

  • Explore a project: It searches files, symbols, and references to answer questions about a codebase.
  • Explain code: It summarises components, dependencies, and flows before proposing changes.
  • Plan tasks: Plan mode can analyse an implementation without editing files by default.
  • Modify code: Build mode can create or edit files and run authorised tools.
  • Review and fix: It can investigate errors, propose refactors, and run project checks.
  • Manage sessions: It supports multiple sessions, undo/redo, and shared conversation links when the user chooses to generate them.

Interfaces, models, and providers

OpenCode is available as a terminal interface, desktop application, and IDE extension. Its official documentation supports many providers through Models.dev as well as local models. It also offers OpenCode Zen as an optional catalogue of models selected for coding agents.

This flexibility does not make every model equivalent. Quality, context window, price, speed, tool support, and data policies depend on the selected provider and model. Ollama is one option for running models locally.

Agents, modes, and permissions

OpenCode includes primary agents for building and planning and allows custom agents or subagents to be defined. Each agent can have a different prompt, model, step limits, and permissions.

Permissions govern actions such as reading, editing, searching, running commands, accessing locations outside the project, or using web tools. Each category can be set to allow, ask, or deny. Plan mode applies a more restrictive baseline for exploration and change preparation without writing by default.

Privacy and security

The project states that OpenCode does not store code or context data. However, when a remote provider is used, the parts of the project sent to the model are subject to that provider’s configuration, terms, and policies. A local installation also does not remove risks from overly broad permissions or destructive commands.

Before using it with sensitive repositories, users should review credentials, exclude secrets, limit permissions, control access to external directories, and verify changes with Git and tests. Session links should only be created when the content can be deliberately shared.

Differences from other AI coding tools

OpenCode shares some capabilities with other development assistants but differs in its architecture, interfaces, and relationship with model providers:

  • Claude Code: Anthropic’s coding agent; OpenCode is open source and supports multiple providers.
  • Codex: OpenAI’s agent within its ecosystem; OpenCode separates the interface from the model provider.
  • Cursor: A code editor with AI features; OpenCode can run in a terminal, desktop app, or extension.
  • AI agent: The general category of systems that use models and tools to complete goals; OpenCode is an implementation for software development.
  • Vibe Coding: A practice of programming through natural-language instructions, not an equivalent product.

The best option depends on the environment, available models, open source requirements, permission controls, cost, and data policies.