White light beams passing through dark-red junction machinery, suggesting requests routed to many different model providers.
OpenCode is a routing junction: one terminal agent that sends your coding work to any of 75+ model providers, cloud or local.

OpenCode is an open-source AI coding agent that runs in your terminal. It reads your repository, edits files, runs shell commands, and completes multi-step tasks through the same read-plan-edit-run loop as Claude Code , but it is not tied to any single model vendor. You point it at Anthropic, OpenAI, Google, a local model, or any of 75+ providers, and the agent behaves the same way underneath. It is released under the MIT license and is built by the team that originated it in the SST open-source ecosystem, now organised under the Anomaly org.

The distinctive design choice is a client/server split. OpenCode runs a headless server that does the real work, and the terminal interface (TUI), a desktop app, an IDE extension, and a web view are all clients that talk to it. That means the same session can be driven from more than one surface, and the agent can run on a remote machine while you attach from your laptop.

Where OpenCode sits in the stack

Clients
Terminal (TUI) Desktop app (beta) IDE extension Web view All front-ends attach to one running server
Server
Headless API server opencode serve Runs the agent loop; default port 4096, can run on a remote host
Agents
build (default) plan (restricted) Subagents: General, Explore, Scout Switch build and plan with Tab; call subagents with @mentions
Tools and permissions
File edits Bash LSP servers Per-tool approval gates
Models
Anthropic, OpenAI, Google Bedrock, Vertex, Azure Local: Ollama, LM Studio, llama.cpp 75+ providers via the AI SDK and Models.dev

Installation

OpenCode ships as a single command install script, and through most package managers.

bash
# Install script (macOS, Linux, WSL)
curl -fsSL https://opencode.ai/install | bash

# Or via a package manager
npm install -g opencode-ai
brew install anomalyco/tap/opencode

Once installed, start it in a project directory. Running with no arguments opens the terminal interface.

bash
cd my-project
opencode          # launch the TUI in the current repo

Two ways to use it

The first pattern is an interactive session. Inside the TUI you run /init once to let the agent survey the project, /connect to authenticate a provider, and /models to choose the model. Press Tab to switch between the full-access build agent and the read-only plan agent, which asks permission before it edits files or runs commands.

bash
# Inside the OpenCode TUI
/init                     # survey the repo and write an AGENTS.md
/connect                  # authenticate a provider (OAuth or API key)
/models                   # pick a model, e.g. anthropic/claude-sonnet-4-5
# type a task, then press Tab to flip between build and plan

The second pattern is a project config file, opencode.json, checked into the repo so the whole team shares one setup. This example pins a model, wires an API key from the environment, and sets the server port.

json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "anthropic/claude-sonnet-4-5",
  "provider": {
    "anthropic": { "options": { "apiKey": "{env:ANTHROPIC_API_KEY}" } }
  },
  "autoupdate": true,
  "server": { "port": 4096 }
}

For scripting and CI, OpenCode also runs one-shot prompts without the interface: opencode run "write unit tests for the auth module".

Typical workflow

Step 1 Connect a model Authenticate any provider with /connect, then pick the model with /models.
Step 2 Plan Use the read-only plan agent to explore the code and agree an approach first.
Step 3 Build Switch to the build agent so it edits files and runs commands to make the change.
Step 4 Review Inspect the diffs, approve gated actions, and commit with your normal git flow.

How it compares

OpenCodeClaude CodeCrushAider
MaintainerAnomaly (SST)AnthropicCharmAider community
LicenseMITProprietaryFSL-1.1-MITApache-2.0
LanguageTypeScriptProprietaryGoPython
Model couplingAny providerAnthropic onlyAny providerAny provider
InterfaceTUI, desktop, IDE, webTerminal, VS Code, desktopTerminal onlyTerminal
Best forMulti-surface, provider choiceDeep Anthropic-native workOne fast Go binaryGit-centric pair coding

Crush deserves a note here because of the shared name. The original OpenCode was a Go project (opencode-ai/opencode); it was archived, and its author continued the work at Charm under the name Crush . The OpenCode described on this page is a separate TypeScript agent that carries the opencode name today. If you want a single self-contained Go binary, Crush is the closer fit; if you want the multi-client server architecture and the build/plan agent system, OpenCode is.

When not to use it

  • You want one static binary with no runtime. OpenCode is a TypeScript stack with a server component. Crush ships as a single Go binary with fewer moving parts.
  • You need a pinned, reproducible CLI. OpenCode releases very frequently and enables auto-update by default. For locked toolchains, disable autoupdate and pin a version, or choose a slower-moving tool.
  • You are all-in on one vendor’s managed features. If you only ever use Anthropic models and want the tightest native integration, subagents, and hooks, Claude Code is built for that. OpenCode trades vendor-specific depth for provider breadth.
  • You want a graphical editor. OpenCode is terminal-first. If you want AI inside a full IDE, Cursor or a VS Code extension such as Cline fits better.

Further reading

Sources