OpenCode is an open-source (MIT) AI coding agent developed by Anomaly and available as a terminal interface, desktop app and web app. It is written mainly in TypeScript; its GitHub repository (anomalyco/opencode, created in April 2025) had more than 210,000 stars as of October 16, 2026. OpenCode avoids vendor lock-in with a provider and model catalog from models.dev: you connect accounts with /connect, pick models with /models, add custom OpenAI-compatible providers in config, or run local models through Ollama, which OpenCode detects automatically at 127.0.0.1:11434.
The agent runs shell commands, edits files and works with full project context, while permissions and policies let developers decide what needs approval, including per-project auto-accept settings. It can be extended with MCP servers, skills, plugins, custom commands, agents and themes, and includes web search, snapshots and context compaction.
OpenCode targets developers who want a powerful, free, and open-source alternative to proprietary AI coding agents like Claude Code, with the flexibility to choose any AI model provider based on performance, cost, or privacy requirements. It is particularly popular among developers who prefer terminal-based workflows, those running local models for offline or air-gapped development, and cost-conscious teams who want enterprise-grade AI coding assistance without monthly subscriptions. OpenCode's MIT license and active community make it a practical foundation for customization and extension.
OpenCode 2.0, announced on October 12, 2026, is a major overhaul. A single background service now runs on the machine by default, and the TUI, web interface, desktop app and scripts all connect to it. That service owns sessions, configuration, integrations, permissions and tool execution; it can be bypassed with --standalone or --server, or disabled with opencode service set disabled true. The new @opencode/client package (clients for vanilla JavaScript and Effect) discovers or starts the local service with Service.ensure(), which is useful for scheduled tasks and scripts, and opencode pair or /pair exposes the service to other devices. Code Mode, built on a minimal JavaScript interpreter in the @opencode/codemode package, turns MCP servers and OpenAPI endpoints into functions the agent can chain inside one execute call instead of calling tools one at a time; all MCP servers use Code Mode by default unless codemode: false is set. 2.0 also adds background subagents and background shell commands, a rebuilt server API, more than 80 internal plugins on a stable plugin API (TUI plugins built on OpenTUI are now stable), hot reloading, and the @opencode/sdk package for embedding OpenCode as a library.
To upgrade from 1.x, update to the latest 1.x release and run opencode upgrade --major. New installs use curl -fsSL https://opencode.ai/v2/install | bash, brew install anomalyco/tap/opencode-v2, npm install -g @opencode/cli or the official WinGet package (Anomaly.OpenCode). Breaking changes are limited: 1.x plugins do not run in 2.0, the server API is completely different, and terminal client configuration moves out of tui.json; other V1 configuration remains backwards compatible. Recent releases include v2.0.29 (October 14, 2026), which added remote device pairing through OpenTunnel, and v2.0.30 (October 15, 2026), which added a docked /diff viewer and removed the retired session-sharing backend and /share command.
On October 17, 2026, OpenCode disclosed on its official X account a security breach, related to a large-scale distillation attack, that affected 1.4% of OpenCode Console users. It said only a subset of users who had linked external providers were affected and that all affected users were notified by email; users who did not receive an email were not affected. OpenCode said the incident was ongoing and that it was working with Anthropic, OpenAI and Google on remediation.




