OpenCode

Canonical version: OpenCode.

Open-source, provider-agnostic AI coding agent built by the SST team (creators of the SST framework). Runs as a TUI, desktop app, or IDE extension. MIT licensed, written in TypeScript, built with Bun.

Explicitly positioned as an open-source alternative to Claude Code, without provider lock-in. Supports 75+ LLM providers via the Vercel AI SDK.

Key features

  • Two primary agents (switch with Tab):
    • build — default, full tool access, makes changes freely
    • plan — read-only analysis, requires approval for edits/bash — good for exploring unfamiliar codebases
  • Subagents: general (multi-step research, invoked via @general), explore (read-only codebase exploration)
  • LSP integration out of the box (language-aware code understanding, unlike Claude Code)
  • Model Context Protocol (MCP) support
  • Client/server architecture: TUI is just one frontend; server can be driven remotely
  • /init command that analyzes the project and generates an AGENTS.md
  • Custom agents defined in opencode.json or markdown files in .opencode/agents/ or ~/.config/opencode/agents/
  • Undo/redo, conversation sharing with teams
  • Desktop app (beta) for macOS, Windows, Linux

Architecture

  • Core: Bun/TypeScript monorepo
  • LLM calls: Vercel AI SDK (@ai-sdk/* provider adapters) — what enables 75+ provider support
  • Concurrency: Effect (functional TypeScript library)
  • TUI: @opentui/core + solid-js (reactive terminal UI)
  • DB: Drizzle ORM + SQLite for local session persistence
  • HTTP server: Hono
  • Parsing: Tree-sitter

Supported providers (sample)

Anthropic, OpenAI, Google (Gemini), Amazon Bedrock, Azure, Groq, Mistral, Cohere, Perplexity, Together AI, xAI (Grok), OpenRouter, Ollama/LM Studio, any OpenAI-compatible API.

Also offers OpenCode Zen (curated model subscription) and OpenCode Go (low-cost open model subscription).

Install

# curl
curl -fsSL https://opencode.ai/install | bash

# npm
npm i -g opencode-ai@latest

# macOS
brew install anomalyco/tap/opencode

# Windows
scoop install opencode

vs Claude Code

OpenCode Claude Code
Open source Yes (MIT) No
Provider Any (75+) Anthropic only
LSP support Yes No
Architecture Client/server (remotely drivable) Local only
Desktop app Yes (beta) No
Custom agents Markdown/JSON config Via CLAUDE.md conventions
MCP support Yes Yes

References


About Sébastien

Ready to get to the next level?

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.

Subscribe