Skip to content
All articles
Tool ReviewsSeptember 4, 202610 min read

OpenCode Review: The Open-Source AI Coding Agent

OpenCode is an open-source AI coding agent that connects to 75+ model providers and runs in your terminal, desktop, or IDE. This review covers features, pricing, and security.

AI Tools Vault Team

AI Tools Vault Team

Editorial Team

Share
OpenCode AI coding agent running in a terminal

The name OpenCode has been appearing in a lot of AI coding conversations, and for good reason. It's an open-source agent that runs from your terminal and connects to whichever model provider you prefer — Anthropic, OpenAI, Google, Groq, a local Ollama instance, or any of more than 75 providers. The core idea is simple: the model behind your coding assistant should be a swappable component, not a product lock-in.

This review covers what it actually does, where it falls short, and why its security model is the thing you should understand before installing it.

What Is OpenCode?

At its core, it's an open-source AI coding agent available as a terminal interface, a desktop app, and an IDE extension. Instead of autocomplete-style suggestions, it works as an agentic workflow: you describe a task in a project and the agent reads files, plans the work, edits across files, runs commands and tests, and iterates on the result. The GitHub repository is MIT licensed, meaning anyone can read, fork, or extend the source.

The terminal is where this tool feels most natural. That's where it started, and it's still the primary interface. But the desktop app and IDE extension cover developers who prefer an editor or standalone window.

Under the hood it uses the AI SDK and Models.dev to connect providers. You can sign in with an existing GitHub Copilot or ChatGPT Plus/Pro account, point it at a local model through Ollama or llama.cpp, or connect an API key from Anthropic, OpenAI, Bedrock, Groq, or many others. There's no vendor lock-in by design.

What Can It Actually Do?

This is a coding agent, not a text completer. Here's what it handles well:

  • Explain unfamiliar code. Ask how authentication works in a specific file, using the @ key to fuzzy-search for it, and it answers with the whole project as context.
  • Plan before touching anything. Plan mode disables changes and produces an implementation plan you can iterate on. Switch to Build mode only when ready.
  • Make multi-file changes. Describe a feature the way you'd explain it to a junior developer, and the agent edits across files, runs builds, and keeps going until the task is done.
  • Run and fix tests. A failing test is feedback; the agent iterates until green.
  • Undo mistakes. The /undo and /redo commands revert or redo changes.

Two features stand out in daily work. First, LSP integration — it's off by default, but once enabled the right language servers start automatically and feed live diagnostics back to the model. Second, share links: /share creates a link to any session so a teammate can review the conversation or help debug. Sessions aren't shared by default.

Multi-session support lets you run several agents in parallel on different parts of a project, and MCP servers let you connect external tools and services.

How the Terminal Workflow Works

Budget a few minutes for first setup — this is where it differs most from a zero-configuration tool.

  1. Install via the official script (curl -fsSL https://opencode.ai/install | bash) or a package manager like npm, Homebrew, Arch, Chocolatey, or Scoop. On Windows, WSL is recommended for full feature compatibility.
  2. Run /connect and pick a provider — OpenCode Zen for a curated starting point, an existing subscription like GitHub Copilot or ChatGPT Plus, or your own API key.
  3. Run opencode in your project directory, then /init to generate an AGENTS.md file the agent uses for structure and conventions.
  4. Start in Plan mode (Tab key), review the plan, then switch to Build mode (Tab again) for actual edits.

The day-to-day loop is mostly two modes. Plan mode produces a plan without touching files. Build mode makes the changes. For big features, plan first; for small ones, skip straight to building.

Main Strengths

The strongest case for this agent is provider freedom. Few coding agents let you bring any model from any provider, run a local model, and still have a first-class agentic workflow. For teams that switch models or developers who want to spend on an existing subscription, that flexibility is the whole point.

Being open source is a real advantage. You can read the code, understand exactly what happens with your prompts, and contribute. The terminal experience is genuinely good — a proper TUI, responsive and keyboard-driven, with Plan/Build mode giving you a lightweight guardrail before changes hit disk.

The privacy posture is notable: the official site says the tool doesn't store your code or context data, and sessions aren't shared unless you explicitly run /share. For privacy-sensitive environments, that matters.

Where It Falls Short

First, it's not zero-configuration. Between installing, choosing a provider, entering API keys, setting up a config file, and running /init, the path to first session is real work. If you want the least possible setup, this will feel like more than you bargained for.

Second, quality is model-dependent. The agent is only as capable as the model powering it. A frontier model through a good provider gives noticeably different results than a cheaper local one.

Third, costs are usage-based. The agent is free, but agentic coding burns tokens fast. Heavy sessions on paid frontier models add up. OpenCode Go ($10/month for open models with defined usage limits) and Zen pay-as-you-go with monthly caps offer ways to manage this, but you do have to think about it.

Fourth, and most important: it is not sandboxed. The official security documentation is explicit — more on that next.

Pricing: What You Actually Pay For

"Free and open source" and "zero cost" aren't the same thing. The layers:

  • The software: free (MIT license).
  • The models: provider-paid. OpenCode Zen has some free models (limited-time), plus per-token paid models. You can also connect an existing provider key.
  • OpenCode Go: optional $10/month subscription for open coding models with usage limits — $12 per 5 hours, $30 per week, $60 per month in dollar value.
  • Existing subscriptions: reusable. GitHub Copilot and ChatGPT Plus/Pro accounts work directly.

Zen pricing is per-token and changes by model, so check the official pricing page rather than relying on a snapshot number.

Is It Safe?

This is the question to ask before installing any coding agent. The answer from the official security documentation is direct and worth quoting: the tool "does not sandbox the agent." The permission system "exists as a UX feature to help users stay aware of what actions the agent is taking" and "is not designed to provide security isolation." If you need true isolation, run it in a Docker container or VM.

Permissions and Approval

Each action gets allow, ask, or deny, configured in the config file globally, per tool, or per path. Defaults are permissive — most actions allow — with three key exceptions: external_directory (paths outside your project) defaults to ask, doom_loop (same tool call repeating) defaults to ask, and .env files are denied by default. Auto mode (--auto) removes the guardrail for trusted environments.

Code and File Access

The agent runs with your user privileges. It can read and edit anything you can. Giving it access to a sensitive codebase is the same as giving any tool with your permissions that access — only point it at repositories you own or trust.

API Keys and Credentials

Keys added through /connect are stored locally in ~/.local/share/opencode/auth.json. MCP OAuth tokens go in ~/.local/share/opencode/mcp-auth.json. Treat those like any credential store: back them up when switching machines, don't share them, and review your config in secrets-heavy repos.

MCP and Third-Party Tools

Each MCP server you add expands the actions and data the agent can reach. The official docs warn that servers add context tokens and recommend being selective. This isn't a claim that MCP is dangerous — it's a scope problem. The more surfaces you connect, the more you're trusting the agent to act safely across all of them. Keep the list short and enable only what you need.

The broader point in the security docs: LLM provider data handling is governed by that provider's policies, and external MCP servers sit outside the tool's trust boundary. "Safe" depends on your whole chain — the model, the servers, and the credentials — not just the agent.

One more layer: server mode is opt-in, and per the security docs it runs unauthenticated (with a warning, not a blocker) unless you set OPENCODE_SERVER_PASSWORD. Secure it before exposing it beyond your machine.

How It Compares to Other Coding Assistants

Claude Code is the closest relative — Anthropic's own terminal agent with a similar workflow. The difference: Claude Code is built around Claude models, while this tool is built around provider choice. If you're all-in on Anthropic, Claude Code is tighter; if you want flexibility, this wins by design.

Cursor is an agentic IDE with visual diffs and a familiar editor, making it more approachable for many developers. This tool is terminal-first with no visual editor — lighter, scriptable, and not locked to one editor, but less accessible if you want a GUI. If you prefer an editor-integrated agent, Cursor fits better.

GitHub Copilot is the enterprise default with governance, breadth, and deep GitHub integration. Interestingly, you can log in to this agent with your existing Copilot subscription rather than competing with it.

For a deeper understanding of MCP, see our guide to MCP servers. You can also browse the full AI coding tools category to compare more options.

Who Should Use It?

The agent suits developers who:

  • Already have an AI subscription and want to reuse it.
  • Prefer terminal workflows and keyboard-driven tools.
  • Want provider freedom across projects.
  • Value reading the source.

Who should be cautious: developers wanting zero setup, teams needing strict blast-radius isolation (use Docker or a VM), and anyone who prefers visual diffs in an IDE — Cursor is the better fit there.

Getting Started Responsibly

  1. Install via the official script or package manager; on Windows, set up WSL first.
  2. Run /connect and choose a provider.
  3. Run the agent in your project, then /init.
  4. Start in Plan mode, review, then switch to Build mode.
  5. Review permissions in the config file and read every prompt before approving.

A final note that applies to any AI coding agent: treat its output as a draft. Review the diff, run your own tests, never approve what you don't understand. The agent is a very fast engineer on your team, not a substitute for your judgment.

Frequently Asked Questions

What is OpenCode?

It's an open-source AI coding agent available as a terminal interface, desktop app, and IDE extension. You describe a task and it reads the codebase, edits files, runs commands and tests, and iterates until the job is done.

Is OpenCode open source?

Yes. The repository on GitHub is MIT licensed, so you can read the source, inspect how it works, fork it, and extend it yourself.

Is OpenCode free?

The tool itself is free and open source. You pay for the models you use — there are free models through OpenCode Zen, or you connect an existing provider or subscription with your own key. OpenCode Go is an optional $10/month subscription for open coding models.

Is OpenCode safe to use?

It is not sandboxed, according to its official security documentation. The permission system helps you review and approve actions, but it is a UX feature rather than a security-isolation boundary. Run it only on repositories you trust.

Can OpenCode use different AI models?

Yes. It supports 75+ LLM providers through Models.dev, including Anthropic, OpenAI, Google, Groq, Bedrock, and local models via Ollama or llama.cpp. You can also sign in with a GitHub Copilot or ChatGPT Plus/Pro account.

Does OpenCode work in the terminal?

Yes, the terminal is its primary interface, but it also ships as a desktop app and IDE extension so you aren't forced to live in the terminal full-time.

Is OpenCode an alternative to Claude Code?

The two are similar terminal-first agents, but OpenCode is designed around provider choice rather than being tied to one model family. Claude Code is built around Anthropic's models; this tool lets you swap providers freely.

Does OpenCode support MCP?

Yes, both local and remote MCP servers. Because each server expands what the agent can access, the official docs recommend being selective about which ones you enable.

Share

Like what you're reading?

Get our best AI tool reviews and guides delivered to your inbox each week. No spam, unsubscribe anytime.

AI Tools Vault Team

Written by

AI Tools Vault Team

Editorial Team

The AI Tools Vault editorial team researches, tests, and reviews the best AI tools across every category.

Related Articles

More reading on tool reviews