> OpenCode is an MIT-licensed terminal coding agent for any model, hosted or local. Agents, permissions, MCP and LSP, plus the data-protection trade-offs.
>
> Web page: https://balazscsorba.com/blog/opencode · Language: English · Also available in: [Deutsch](https://balazscsorba.com/de/blog/opencode.md) · [Magyar](https://balazscsorba.com/hu/blog/opencode.md)
> Author: Balázs Csorba · Published: 2026-10-09 · Keywords: opencode, opencode review, open source coding agent, opencode vs claude code, terminal coding agent, opencode local models, opencode permissions, opencode mcp

[Blog](https://balazscsorba.com/blog)/AI agents

# OpenCode review: the open-source coding agent for any model

OpenCode is an MIT-licensed terminal coding agent for any model, hosted or local. Agents, permissions, MCP and LSP, plus the data-protection trade-offs.

[Balázs Csorba](https://balazscsorba.com/about)·October 9, 2026·8 min read

-   AI coding agent
-   Terminal
-   Open source
-   Local models
-   MCP

![One central box fed from two sides with four squares inside, above a level balance.](https://balazscsorba.com/images/blog/opencode/cover.webp?v=a657f77ec7)

## Key takeaways

-   OpenCode is MIT-licensed and free to install. You pay for the model, through your own provider key, a local model or the optional Zen and Go plans.
-   Its provider layer reaches more than 75 providers through the AI SDK and Models.dev, and local models through Ollama, LM Studio or llama.cpp.
-   The Build and Plan agents separate doing from planning, but most permissions default to allow, so you must write your own approval rules before the first real run.
-   MCP servers and LSP diagnostics extend the agent. Each MCP server adds to the context you pay for, so enable them one at a time.
-   With your own provider, code goes straight from your machine to that provider. The exception is /share, which publishes a public link on opencode.ai.

On this page

1.  [What it is](https://balazscsorba.com/#what-it-is)
2.  [How it works](https://balazscsorba.com/#how-it-works)
3.  [Getting started](https://balazscsorba.com/#getting-started)
4.  [Agents and permissions](https://balazscsorba.com/#agents-and-permissions)
5.  [Providers and local models](https://balazscsorba.com/#providers-and-local-models)
6.  [Cost and deployment](https://balazscsorba.com/#cost-and-deployment)
7.  [Where it falls short](https://balazscsorba.com/#where-it-falls-short)
8.  [Verdict](https://balazscsorba.com/#verdict)
9.  [Sources](https://balazscsorba.com/#sources)

Listen to this article

0:000:00

OpenCode is an open-source AI coding agent for the terminal, also available as a desktop app and an IDE extension. The verdict up front: take it if you want one agent that can run whichever model you can connect, including a model on your own machine, and you are prepared to write its permission rules. Leave it alone if you want one vendor's model under one subscription, or if you expect safe defaults out of the box.

This review rests on the official OpenCode docs, the GitHub repository and the v1.18.35 release, published on 6 October 2026. I did not benchmark it, so the comparison covers features, licences and prices, not output quality.

## What it is

OpenCode is a terminal interface, a desktop app and an IDE extension. The source is at anomalyco/opencode on GitHub under the MIT licence, and the repository showed about 212.5k stars when I checked on 10 October 2026. The docs also carry a banner for a v2 release. The v2 page I opened had no details, so the specifics below refer to the v1.18 line.

-   **Install:** a shell script, npm (opencode-ai), Bun, pnpm or Yarn, Homebrew through the anomalyco tap, and AUR or Nix packages.
-   **Models:** more than 75 providers through the AI SDK and Models.dev, plus any OpenAI-compatible endpoint you configure.
-   **Clients:** the terminal UI, the desktop app, IDE extensions, a browser interface from opencode web, and ACP-compatible editors such as Zed and JetBrains IDEs.
-   **Project rules:** an AGENTS.md file, which the /init command creates or updates, is added to the model's context.

## How it works

The docs describe a client and server split. The command`opencode serve` runs a headless HTTP server with an OpenAPI endpoint that any OpenCode client can use, so the interface and the agent can run in separate processes. Every tool call is checked against the permission rules before it runs.

![How an OpenCode request flows Clients such as the terminal UI, the desktop app or an IDE send requests to a local opencode server over HTTP. The agent loop runs in Build or Plan mode. Before each tool call, the permission gate allows, asks or denies the action. Tools read and edit files, run shell commands, use language servers and call MCP servers. The model call goes to the provider you configure, which can be a hosted API or a local model.](https://balazscsorba.com/images/blog/opencode/diagram-7.webp?v=b0c5d30394)

Clients talk to one local server. The permission gate checks each tool call, and the model is whichever provider you configure.

Tools do the actual work. Built-in tools read, write and patch files, run shell commands and fetch web pages, and each has its own permission key. The language server layer passes diagnostics from the project's language servers back to the agent, which the docs present as feedback for the agent.

### MCP and LSP

MCP servers sit under the `mcp` key. A local server is a command that OpenCode starts. A remote server is a URL, with optional headers, an OAuth block and a timeout that defaults to 5 seconds for fetching its tool list. The docs warn that every MCP server adds to the context you pay for, and that some, such as the GitHub MCP server, can exceed the context limit on their own. LSP works differently. OpenCode ships configurations for more than 30 language servers, from TypeScript, Rust and Python (pyright) to Go (gopls) and Terraform, and setting `lsp` to true enables all of them. Some install themselves; others need the toolchain on your path.

## Getting started

Install with the shell script or `npm install -g opencode-ai`, then run `opencode` in the project directory. Inside the TUI, `/connect` adds provider keys and `/init` writes the AGENTS.md file. The configuration below points OpenCode at a model served by LM Studio on the same machine, sets the default permission to ask and turns sharing off. Put it in `opencode.json` at the project root, or in `~/.config/opencode/opencode.json` for every project.

```
{
  "$schema": "https://opencode.ai/config.json",
  "model": "lmstudio/google/gemma-3n-e4b",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": { "baseURL": "http://127.0.0.1:1234/v1" },
      "models": { "google/gemma-3n-e4b": { "name": "Gemma 3n-e4b (local)" } }
    }
  },
  "permission": { "*": "ask", "bash": "ask" },
  "share": "disabled"
}
```

A local model keeps prompts on your machine, but the quality of the result is the model's, not the agent's. Run the first tasks on a scratch branch and read every diff before you accept it.

## Agents and permissions

Two primary agents do the main work. Build is the default, with every tool enabled, and suits development. Plan is restricted to analysis and review, and the docs say it makes no code changes. Press Tab to switch between them. OpenCode also has three built-in subagents. Explore is a fast, read-only agent for finding files and answering questions about the code, Scout is read-only and researches external docs and dependency source, and General is the third. You can call any of them with an @ mention.

Permissions are where you should spend your first hour. Each key accepts allow, ask or deny, and the object form can match on the tool input. The keys that matter most are `edit` (which covers write, edit and apply\_patch), `bash`, `webfetch`, `external_directory` and `doom_loop`. A `*` key sets the default for everything else, and explicit deny rules still apply under `--auto`.

**The defaults are permissive**

Most permissions start at allow. The docs set doom\_loop and external\_directory to ask and deny .env files, but bash and edit run without a prompt unless you change them.

The --auto flag approves every request that is not explicitly denied. Treat it as a setting for a throwaway sandbox, not for a laptop with production credentials.

## Providers and local models

This is the main reason to pick OpenCode. It uses the AI SDK and the Models.dev catalogue to cover more than 75 providers, `/connect` stores the keys you add, and the `baseURL` option points any provider at a proxy or a private endpoint. The provider directory lists local options such as Ollama, LM Studio and llama.cpp, and any other OpenAI-compatible server can be added with the `@ai-sdk/openai-compatible` package.

Provider-agnostic does not mean equally good. The agent is only as reliable as the model behind it, especially for tool calls in a large repository. Keep a second model configured, so you can switch when one struggles, and compare the diffs they produce on the same task before you commit to either.

## Cost and deployment

The software costs nothing. You pay for the model, and the bill depends on where that model runs. As of October 2026 the published options are these.

Option

Price

What it covers

OpenCode

Free, MIT

Install and run; you pay your model provider directly

Zen

Pay as you go, per 1M tokens

Tested models hosted in the US and EU; zero retention except some free models

Go

$10 a month

Open coding models with monthly dollar limits

Go Plus

$40 a month

Higher monthly limits at the same token prices as Go

Enterprise

Per seat, quoted

Central config, SSO, and your own LLM gateway with no token charge

Self-hosting here means running the model on your side, because the agent already runs on your machine. The data-protection question is who processes your code. OpenCode's enterprise page says it does not store any of your code or context data, and that all processing happens locally or through direct API calls to your AI provider. That makes the provider the party you need a contract with.

Under Article 28(3) of the GDPR, processing by a processor must be governed by a contract that binds the processor. If your repositories or test data contain personal data, get that contract, the processing region and the retention terms in writing from the provider you connect. Zen's published policy is a useful benchmark: its models are hosted in the US and EU, its providers follow zero retention and do not train on your data, with named exceptions for free models during their free period. The wider residency checklist is in the [GDPR LLM data residency guide](https://balazscsorba.com/blog/gdpr-llm-api-eu-data-residency).

**Three places data can leave your machine**

The model call, unless the model runs on your machine.

The /share command, which publishes a conversation as a public link on opencode.ai's CDN. Sharing defaults to manual, and /unshare deletes the data.

Web fetch and web search tools, and any remote MCP server, which send requests outside the model call.

## Where it falls short

Most of the weak points are defaults and upkeep rather than missing features.

-   **Permissive defaults.** Most permissions start at allow, and --auto removes the prompts altogether, so the safe setup is one you write and test yourself.
-   **Context cost from MCP.** Each enabled server adds to the context. Enable one server at a time and measure what it costs before you add the next.
-   **Configuration keeps moving.** The legacy tools boolean was merged into permission in v1.1.1, and the old key still works. Check examples against the version you run.
-   **Shares are public.** Anyone with the link can read a shared conversation until someone unshares it.
-   **Team controls sit behind a quote.** Central config, SSO and gateway enforcement are enterprise features, priced per seat.
-   **A version question.** The docs point to a v2 release. Pin the version your team tests and retest after each upgrade.

## Verdict

OpenCode is the open option for teams that must keep the choice of model open. Pick it when you want an MIT-licensed agent, when code should go only to a provider you have contracted, or when local models are part of the plan. Do not pick it if you want safe behaviour without writing the rules yourself, or if one vendor's model is the requirement.

Tool

Licence

Models

Price, as of October 2026

OpenCode

MIT

75+ providers and local models

Free software; you pay the provider, or Zen and Go

Claude Code

Anthropic commercial terms

Claude models; no non-Claude models through gateways

Pro $17 a month billed yearly, $20 monthly; Max from $100

Codex CLI

Apache-2.0

OpenAI models, plus custom providers in config.toml

Included in ChatGPT plans, Free to Enterprise

Aider

Apache-2.0

Almost any LLM, including local models

Free software; you pay the provider

1.  **Claude Code** if you already work with Claude models and accept a commercial licence in return for Anthropic's own agent. The review is [Claude Code review](https://balazscsorba.com/blog/claude-code).
2.  **Codex CLI** if your team already has ChatGPT plans and wants an Apache-2.0 agent. Its review is [Codex CLI review](https://balazscsorba.com/blog/openai-codex-cli).
3.  **Aider** if you want a smaller, git-first tool that commits each change with a sensible message and reaches almost any model. Its review is [Aider review](https://balazscsorba.com/blog/aider).

## Sources

-   [OpenCode docs: intro and installation](https://opencode.ai/docs/)
-   [OpenCode docs: providers, Models.dev and local models](https://opencode.ai/docs/providers/)
-   [OpenCode docs: agents, Build, Plan and subagents](https://opencode.ai/docs/agents/)
-   [OpenCode docs: permissions and defaults](https://opencode.ai/docs/permissions/)
-   [OpenCode docs: MCP servers](https://opencode.ai/docs/mcp-servers/)
-   [OpenCode docs: LSP servers](https://opencode.ai/docs/lsp/)
-   [OpenCode docs: server and web interface](https://opencode.ai/docs/server/)
-   [OpenCode docs: config and precedence](https://opencode.ai/docs/config/)
-   [OpenCode docs: Zen, pay-as-you-go models](https://opencode.ai/docs/zen/)
-   [OpenCode docs: Go subscription plans](https://opencode.ai/docs/go/)
-   [OpenCode docs: share and data retention](https://opencode.ai/docs/share/)
-   [OpenCode docs: enterprise and data handling](https://opencode.ai/docs/enterprise/)
-   [GitHub: anomalyco/opencode, MIT licence and README](https://github.com/anomalyco/opencode)
-   [OpenCode release v1.18.35 (6 October 2026)](https://github.com/anomalyco/opencode/releases/tag/v1.18.35)
-   [Claude Code licence file (LICENSE.md)](https://raw.githubusercontent.com/anthropics/claude-code/main/LICENSE.md)
-   [Claude pricing: plans and Claude Code access](https://claude.com/pricing)
-   [Claude Code docs: connect to an LLM gateway](https://code.claude.com/docs/en/llm-gateway)
-   [OpenAI Codex CLI repository (Apache-2.0)](https://github.com/openai/codex)
-   [ChatGPT pricing: Codex included in plans](https://learn.chatgpt.com/docs/pricing)
-   [Codex configuration: model providers and config.toml](https://learn.chatgpt.com/docs/config-file/config-advanced)
-   [Aider website: git integration and LLM support](https://aider.chat/)
-   [Aider licence file (Apache-2.0)](https://raw.githubusercontent.com/Aider-AI/aider/main/LICENSE.txt)
-   [GDPR, Regulation (EU) 2016/679, Article 28](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679)

## Frequently asked questions

Is OpenCode free?

The software is free under the MIT licence. You pay your model provider for tokens, pay as you go through Zen, or subscribe to Go at $10 a month or Go Plus at $40 a month. Prices are as of October 2026.

Can OpenCode run without a cloud provider?

Yes. The provider directory covers local options such as Ollama, LM Studio and llama.cpp. Prompts and code stay on your machine, but web tools and remote MCP servers still send requests out, and output quality depends on the model you run.

Does OpenCode store my code?

According to its enterprise page, OpenCode does not store any of your code or context data, and processing happens locally or through direct API calls to your AI provider. Using /share is the exception, because the conversation is then published through opencode.ai.

How does it compare with Claude Code?

OpenCode is open source and provider-agnostic. Claude Code is under Anthropic's commercial terms, and Anthropic says it does not support routing Claude Code to non-Claude models through any gateway.

Written by Balázs Csorba

Senior fullstack & AI engineer in Styria, Austria – 10+ years of Vue, Nuxt, Node.js and PHP, now building tooling for AI agents.

[AI engineering & MCP servers →](https://balazscsorba.com/expertise/ai-engineer)[About me →](https://balazscsorba.com/about)

## More articles

-   [Designing tools for AI agents: names, descriptions, schemas and error messages](https://balazscsorba.com/blog/agent-tool-design-descriptions-errors)
-   [Migrating a legacy codebase with coding agents: a strangler fig playbook](https://balazscsorba.com/blog/coding-agents-legacy-codebase-migration)
-   [Background coding agents that open PRs: a practical async workflow](https://balazscsorba.com/blog/background-agents-async-pr-workflow)
-   [Context rot in long-running agents: clearing, compaction, memory and sub-agents](https://balazscsorba.com/blog/context-rot-compaction-long-running-agents)

## Sounds like what you need?

Tell me about your project or role – I’d love to hear from you.

[Get in touch](mailto:contact@balazscsorba.com) [Connect on LinkedIn](https://www.linkedin.com/in/balazs-csorba)
