OpenCode 2.0: What Changed From Version 1 and What It Means for Teams
What the rebuilt open source coding agent changes, and what to check before you move.
OpenCode 2.0 is a rebuilt open-source artificial intelligence (AI) coding agent featuring a background service, an embeddable software development kit (SDK), and JavaScript code execution for external tool calls. Creator Anomaly announced the release as a major overhaul, as reported by the AI-Augmented Engineer newsletter on October 13, 2026.
At Layer3Labs, we build custom agents, enterprise integrations, and advisory engagements for small and mid-sized business workflows across the United States, and we do not sell software licences.
What OpenCode Is and What Version 2.0 Changes
OpenCode is an open-source AI coding agent. OpenCode describes itself as 'The open source AI coding agent' and 'an open source agent that helps you write code in your terminal, IDE, or desktop.'
It does not store your code or context data according to statements on the OpenCode website. OpenCode's site reports over 208,000 GitHub stars, 950 contributors, over 13,000 commits, and over 16M developers every month.
Free models are included. Users can also connect to more than 75 large language model (LLM) providers via Models.dev, including Claude, GPT, Gemini, and local models. Developers can run multiple parallel sessions on a single project, and the site lists share links for sessions. Engineers can log in with an existing GitHub Copilot account or a ChatGPT Plus or Pro subscription.
Shared Background Service and Rebuilt API
In OpenCode 2.0, the server runs as a background service. The server starts automatically as a single background service on your local machine.
The terminal interface, desktop application, and web client all communicate directly with this background service. A programmatic client package, @opencode/client, automatically discovers this local background service when initialized. Developers can issue calls from the command-line interface (CLI) using opencode api commands. Teams can also expose the background service to remote machines and link environments using /pair or the opencode pair command.
Anomaly rebuilt the application programming interface (API) completely from scratch for the version 2.0 release. OpenCode knows its own API and can call it, for example to move the current session into a git worktree.
Code Mode Execution and Background Tasks
Code mode executes external tool calls through an embedded JavaScript runtime so one script makes several tool calls in one round trip. The @opencode/codemode package contains a minimal JavaScript interpreter designed for tool execution. It ingests Model Context Protocol (MCP) servers or OpenAPI endpoints directly.
The engine translates these external endpoints into standard JavaScript functions that OpenCode can invoke in a script. A single script can call an external tool, map over the returned data, and pass results to another tool in one round trip. Every MCP server opts into code mode by default in version 2.0. Anomaly states that developers can connect a thousand MCP servers with minimal context bloat.
Background tasks operate alongside code mode. The primary agent can launch background subagents to handle distinct subtasks without interrupting foreground work. Subagents can even use a different model tailored to their specific assignment. Background shell commands run asynchronously, and the runtime notifies the agent once execution finishes. A dedicated hotkey allows developers to shift any active foreground command or subagent into the background.
Plugins, Embeddable SDK, and Client Architecture
The OpenCode 2.0 architecture separates the core engine into an embeddable runtime library, a network client, and an internal plugin structure. The initial version 1.0 plugin system never received the development focus it required. Anomaly says the 1.0 plugin system never got the attention it needed.
In OpenCode 2.0, nearly every core capability operates as an internal plugin (80+ internal plugins). Terminal user interface plugins have transitioned from experimental status to stable, powered by OpenTUI. The system supports dynamic hot-reloading throughout active sessions. Because of hot-reloading, OpenCode can write a custom plugin for itself and load it immediately mid-session. Version 2 plugins define a named extension and register actions via a structured context object. Legacy version 1 plugins are incompatible with version 2.0 and must be rewritten for the new plugin API.
The codebase separates client networking from the host runtime. The @opencode/sdk package allows developers to embed the agent engine directly into external software as a library using the same code that powers the CLI runtime. The SDK runs without opening an HTTP listener, per the newsletter. It speaks the standard OpenCode server protocol so any OpenCode client can connect. An optional Effect-based API is also under active development. In contrast, @opencode/client connects over HTTP to a server that is already running.
On October 12, 2026, Cloudflare announced experimental support for OpenCode 2.0 within its Agents SDK. The implementation uses an experimental OpenCodeHarness running inside a Durable Object with SQLite session persistence. The newsletter notes the support is early. The Cloudflare Workerd environment does not have the filesystem and process capabilities of a standard developer computer.
Permission Controls
OpenCode 2.0 regulates tool access through an ordered rule list that defines specific actions, targets, and enforcement effects. Security rules sit in a single ordered permissions array.
Each entry sets an action, a target resource, and an execution effect. For instance, a rule can specify a shell action on the resource pattern 'git push *' with the effect 'ask'. This configuration forces the agent to prompt the user before pushing code to a remote repository.
Cost depends on how you reach models: free models or provider keys. See OpenCode Pricing.
Steps to Verify Before an OpenCode 2.0 Upgrade
Upgrading to OpenCode 2.0 introduces breaking changes across plugins, the server API, and clients (see OpenCode 2.0 Migration Guide). Because version 1 plugins do not function on version 2, developers must port them to the new plugin API.
Review the official OpenCode Migration Documentation to check configuration differences. We also document common migration pitfalls in our OpenCode 2.0 Migration Guide. For package-managed installations, see /guides/opencode-2-migration. Fresh installations run via curl -fsSL https://opencode.ai/v2/install | bash.
If you have an existing setup, update your installation to the latest 1.x release first. Once updated, run opencode upgrade --major in your terminal to complete the upgrade. Desktop application users should download the latest binary directly from opencode.ai.
Business Workflow Automation with the OpenCode Runtime
Organizations can use the OpenCode 2.0 SDK and client packages to embed automated coding agents into internal developer tooling and background services.
By using @opencode/sdk, a business can embed the agent runtime directly into internal tooling or server environments. The runtime operates without exposing an external HTTP listener. A business could call a running server from scheduled jobs through @opencode/client. The documentation does not describe this use.
The new permissions array provides guardrails. For example, teams can configure an ask rule on 'git push *'. For comparisons with alternative developer agents, read our evaluations of Claude Code vs OpenCode and Hermes Agent vs OpenCode.
Testing and Rollout Planning
Testing OpenCode 2.0 in an isolated development environment ensures that permission rules and model configurations behave as expected. Begin by installing the runtime on a secondary test machine or a staging branch.
Test your ordered permission rules to confirm that sensitive shell operations prompt for approval.
Frequently Asked Questions
- OpenCode 2.0 is an open-source AI coding agent overhauled with a shared background service, an embeddable SDK, a rebuilt API, and JavaScript code execution for tool calls.
- OpenCode is open source and includes free models, or users can connect external models including Claude and GPT. See OpenCode Pricing.
- Yes, OpenCode connects to more than 75 model providers through Models.dev, supporting Claude, GPT, Gemini, and local model installations.
- No, version 1 plugins are incompatible with OpenCode 2.0 and developers must port existing extensions to the new structured plugin API.
- The @opencode/client package is a network library that connects over HTTP to an existing running server, while @opencode/sdk embeds the entire agent runtime directly inside an application or serverless worker without an HTTP listener.
Evaluating OpenCode 2.0 for Your Engineering Team?
Book a consultation and we will map where a coding agent fits your workflow and what guardrails it needs.
Book a Consultation