AI & DevelopmentOpen SourceDeveloper Tools

OpenCode 2.0: Your CLI Agent Now Runs as a Background Service

OpenCode 2.0 background service architecture diagram showing CLI, web and desktop clients connecting to a shared service

OpenCode 2.0 shipped October 12 with one architectural change that reframes what the tool actually is. It is no longer a CLI application that runs while your terminal is open. It is now a background service — your terminal, desktop app, and web UI all connect to it as clients. Start a refactor, close the tab, come back in an hour: the work kept going. That single shift transforms OpenCode from a fast terminal tool into something closer to a programmable development platform you access through whatever surface you happen to prefer.

One Service, Every Client

In OpenCode 1.x, each frontend — terminal, desktop, web — ran its own isolated instance. Sessions didn’t persist when you closed a window. If you were mid-review and your terminal crashed, you started over.

OpenCode 2.0 runs a single background service automatically. The terminal UI, web interface, and desktop app are now clients of that service, not separate programs. Sessions are shared. Start a code review in the terminal, check on it from the desktop app, pick up the diff in the web UI. Same session throughout, even after the originating window is gone.

If you have ever worked with an LSP server, the model is immediately recognizable: one server process, multiple editor clients, shared state. Anomaly applied the same pattern to their agent runtime — and it is a good fit. The per-user service registers at ~/.local/state/opencode/service.json and starts automatically on first launch.

For teams running long-horizon agent tasks — full-repo refactors, multi-file architectural changes, batch test generation — this removes the need to keep a terminal window pinned and babysit a progress bar. Kick it off, go do something else, come back to results.

Code Mode: Fixing the MCP Context Problem

MCP tool use has a structural inefficiency: every tool call is a separate round trip between the model and the tool server. On a complex workflow with 15 tool calls, that is 15 exchanges, each appending to the context window. At scale, the context fills fast and reasoning quality degrades.

Code Mode solves this differently. Instead of asking the model to call one tool at a time, the agent writes a short JavaScript script that chains multiple tool calls in a single execution. The interpreter in the new @opencode/codemode package converts MCP servers and OpenAPI endpoints into callable functions. The agent writes the script, the interpreter runs it, and the combined result comes back in one turn.

OpenCode’s official changelog reports a 69% reduction in MCP context bloat with Code Mode enabled. In 2.0, it is on by default for all MCP servers. If you maintain integrations with many MCP tools or OpenAPI endpoints, this is the most practically valuable change in the release.

The SDK: OpenCode as a Library

Two new packages ship with 2.0:

  • @opencode/client: A network client that automatically discovers the running background service and provides programmatic control — create sessions, send prompts, manage worktrees from JavaScript or TypeScript.
  • @opencode/sdk: Embeds the entire OpenCode server in-memory inside your application. No HTTP listener, no network hop. The agent becomes a library dependency you can ship as part of your own tooling.

Install with bun add @opencode/sdk. The SDK supports full worktree lifecycle management — create an isolated Git worktree per task, run the agent against it, remove it when done. Full API reference is in the OpenCode SDK documentation. For anyone building developer tooling on top of OpenCode, this is the interface to reach for.

What Breaks in the Upgrade

Three things break when moving from 1.x to 2.0:

  1. V1 plugins: The plugin API changed completely. V1 plugin implementations do not run in V2. You need to rewrite them using the new API.
  2. Server API integrations: Anything talking to the old server API needs updating to @opencode/client.
  3. Terminal configuration: The tui.json config file moves to ~/.config/opencode/cli.json, though V2 handles this migration automatically on first start.

Agents, commands, skills, and most other config files carry over without changes. The core migration is straightforward. The plugin rewrite is not — if you have custom V1 plugins, budget time for it.

To upgrade: run opencode upgrade --major from your shell, or /update from inside the agent. If you have a package-managed V1 installation, remove it first. The full V1 to V2 migration guide covers edge cases.

Where OpenCode 2.0 Fits

The coding agent landscape in late 2026 has three credible options at the top:

  • Claude Code: Strongest reasoning quality, Anthropic-only, $20/month. Best for deep autonomous backend work where reasoning depth matters most.
  • Cursor: IDE-native editing loop, now SpaceX-owned, $20/month. Best for the GUI-centric developer who lives in a visual editor.
  • OpenCode 2.0: Model-agnostic (75+ providers including local models via Ollama), MIT licensed, no subscription — you pay API costs only. Best when model flexibility, privacy, or zero vendor lock-in are requirements.

OpenCode 2.0’s 214,000 GitHub stars and 7.5 million monthly active developers make it the most widely adopted open-source coding agent by a significant margin. The New Stack’s deep-dive frames the 2.0 release as Anomaly’s bid to move from “the free alternative to Claude Code” to a full development platform. That framing is accurate.

The 2.0 release does not change the fundamental tradeoff: if you need the best reasoning quality available, Claude Code still wins. But if you want a tool you can inspect, modify, embed in your own stack, and run with any model including local ones, OpenCode 2.0 is now a meaningfully more capable platform than it was two weeks ago.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *