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 is available through a terminal interface, desktop application, and IDE extension.
It is not a language model but a working layer that connects the repository, tools, and model selected by the user. It supports different providers and local models, so its capabilities, costs, and data handling also depend on the configuration.
How OpenCode works
The user starts OpenCode inside a project, connects a provider, and selects a model. The agent examines permitted files, uses repository context, and may rely on search, LSP servers, file editing, and system commands. The official OpenCode documentation lists installation and configuration methods.
The initialisation command can analyse the project and create an AGENTS.md file describing its structure and conventions. These instructions provide persistent context for the work, but they do not guarantee that every response or modification will be correct.
OpenCode sends the model the context required to process a request and receives a response that may include text or tool calls. Applicable permissions determine whether an action runs automatically, requests approval, or is blocked.
What OpenCode can do
Available functions depend on the agent, model, tools, and configured permissions. Common uses include:
- Explore projects: search files, symbols, and references to answer questions about a codebase.
- Explain code: summarise components, dependencies, and flows before proposing changes.
- Plan tasks: investigate an implementation and propose a sequence of work.
- Modify files: create or edit code when the agent has permission.
- Run checks: use commands, tests, analysers, or other permitted tools.
- Manage sessions: maintain separate conversations, undo or redo changes, and create child sessions.
Generated output should be reviewed before integration. A passing test does not independently prove that a change is safe, complete, or suitable for every case.
Interfaces, models, and providers
OpenCode can be used through a terminal interface, desktop application, or IDE extension. Its design separates the interface from the provider and supports commercial services, compatible gateways, and locally executed models. OpenCode Zen is an optional catalogue of models selected by the project for coding tasks.
Models are not equivalent. Quality, speed, context window, price, tool support, and data policies vary by option. Ollama is one alternative for running models on local infrastructure.
Selection should also consider usage limits, data residency, and the authentication method required by each provider. Open source describes the OpenCode software, but it does not make a connected remote model open or local.
Agents, modes, and permissions
OpenCode distinguishes primary agents from subagents. Primary agents maintain the central conversation, while subagents may specialise in exploration, research, or other tasks. Each one can define a prompt, model, step limit, and individual permissions.
Build and Plan are the included primary agents. Build has tools intended for implementation. Plan applies a more restrictive configuration for analysis and change preparation, but the current documentation sets file editing and shell commands to request approval by default rather than blocking them absolutely.
Rules support three outcomes: allow, ask, or deny. They may apply globally or through patterns for commands and paths. Auto-approval accepts requests that would normally ask, while explicit deny rules remain enforced. Configuration review is necessary before assuming what an agent can execute.
Privacy and security
The project states that the OpenCode service does not store code or context data and that processing occurs locally or through direct calls to the provider. This does not mean no information is stored: the application keeps sessions and configuration on the device, while a remote provider applies its own terms and policies to received data.
The sharing feature creates a public URL and synchronises session history, messages, responses, and metadata with the service’s servers. The conversation remains accessible until it is unshared. Sensitive projects should keep sharing disabled and exclude proprietary code, credentials, and confidential information.
Broad permissions may also allow destructive changes or commands. Users should exclude secrets, restrict directories and tools, review the diff, retain version control, and run tests. A local model reduces transfer to a remote provider but does not remove the agent’s operational risks.
Differences from other tools
OpenCode shares capabilities with other development assistants but differs in scope, architecture, and integration:
- 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 objectives.
- Vibe Coding: a practice of programming through natural-language instructions, not an equivalent product.
The suitable alternative is context dependent, according to available models, required control, cost, integrations, and data policies. Open source status is a relevant criterion, but it does not replace technical and security evaluation.
