OpenCode is the open source AI coding agent Matt Pocock's GLM-5.2 thread kept naming alongside Pi and ZCode: "OpenCode is my preference. Honestly been having comparable results to Opus in my recent usage." With 160,000+ GitHub stars, 900 contributors, and marketing claiming 7.5M monthly developers, it has become the default model-agnostic harness for teams that refuse vendor lock-in.
Unlike a chat wrapper, OpenCode is a full agent harness — tool loop, LSP integration, session management, plan/build modes — shipped as terminal TUI, desktop app (beta on macOS, Windows, Linux), and IDE extension. You connect any model from any provider (Claude, GPT, Gemini, GLM-5.2, local Ollama) or use OpenCode Zen for a curated, benchmarked model list.
Loop controller — Plan mode (read-only planning) vs Build mode (Tab to toggle)
Verification — Git-backed /undo and /redo (requires Git repo)
Multi-agent — parallel sessions on the same project; subagents via command frontmatter
What makes OpenCode distinct in 2026 is surface area + openness: one harness, three UIs, 75+ providers, and a privacy story — OpenCode does not store your code or context data, so it can run in regulated environments (provider APIs still apply their own retention rules).
By the numbers (from opencode.ai, June 2026): 160K+ GitHub stars, 900+ contributors, 13K+ commits, and marketing citing 7.5M monthly developers — scale that matters because OSS harnesses live or die on issue velocity, provider adapters, and community command libraries in .opencode/commands/.
Windows: Chocolatey, Scoop, or npm. Docker: docker run -it --rm ghcr.io/anomalyco/opencode.
Desktop app:opencode.ai/download — beta on macOS, Windows, Linux for developers who want GUI without giving up the same agent core.
First session: connect, init, build
bash
cd /path/to/your/project
opencode
Inside the TUI:
Step
Command
What it does
1
/connect
Add provider — Zen, Anthropic, OpenAI, Z.AI Coding Plan, Ollama, Copilot OAuth, etc.
2
/models
Pick model (e.g. GLM-4.7, GLM-5.2 when available on your provider)
3
/init
Analyze repo → create AGENTS.md (same filename as Codex)
4
Tab
Toggle Plan mode (suggest only) vs Build mode (edit files)
Example workflow from official docs: describe a feature in Plan mode, iterate on the plan, Tab back to Build mode, say "Go ahead and make the changes." For surgical edits, skip planning and reference files directly:
snippet
We need auth on /settings — mirror @packages/functions/src/notes.ts in @packages/functions/src/settings.ts
OpenCode automatically loads the right LSPs for the language context the LLM is working in — diagnostics, symbols, and navigation without manual server wiring. That puts it closer to IDE-integrated agents than bare terminal chat. oh-my-pi goes further on LSP-as-tools; OpenCode bakes baseline LSP into the default harness.
Multi-session parallelism
Start multiple agents in parallel on the same project — useful for "fix tests in thread A, update docs in thread B" without context bleed. Pair with explainx.ai agent loops by giving each session a different kickoff prompt and verification target.
Share links
/share creates a link to the current conversation for debugging or handoffs. /export for offline artifacts. Team review of agent runs without screen recordings.
Bring your existing subscriptions
OpenCode supports OAuth flows many harnesses omit:
Plus standard API keys for Anthropic, Google, etc. Credentials land in ~/.local/share/opencode/auth.json per providers docs.
75+ providers and local models
OpenCode uses the AI SDK and Models.dev registry. Local paths documented include Ollama, LM Studio, llama.cpp, Atomic Chat, and NVIDIA NIM. Custom baseURL in opencode.json supports proxies and Z.ai-style endpoints.
OpenCode Zen
OpenCode Zen is a curated model list OpenCode benchmarks for coding agents — transparent pay-as-you-go ($20 balance, auto top-up), usable with any agent (not locked to OpenCode). Solves "which model/provider combo actually works?" without testing 40 combinations yourself. Zero markup on inference; spend limits available.
OpenCode's extensibility sweet spot is markdown slash commands in .opencode/commands/:
markdown
---
description: Run tests until green
agent: build
model: provider/model-id
subtask: false
---
Run the test suite. Fix failures. Stop when all tests pass.
Arguments: $ARGUMENTS
$ARGUMENTS, $1/$2, @path, !shell` — same patterns as our commands reference
subtask: true — force subagent isolation for heavy tasks
MCP servers — configure in OpenCode config for web search, docs, internal tools; browse explainx.ai/mcp-servers for ideas
Kilo Code rebuilt its VS Code extension on OpenCode as the portable server — evidence the harness is becoming shared infrastructure across CLIs and IDEs.
Privacy and data
OpenCode's pitch: privacy first — the product does not store code or context on OpenCode infrastructure. Your prompts still go to whichever model provider you connect (Anthropic, Z.ai, OpenCode Zen hosts in the US with zero-retention policies per their FAQ). For enterprise evals, that split matters: harness local, inference remote.
Contrast with cloud-only agents that sync sessions by default. OpenCode + local Ollama is the air-gapped path; OpenCode + Zen is the "we tested these models" path.
OpenCode vs other harnesses
vs Claude Code
Claude Code wins on Anthropic-native /loop, /background, and Opus integration out of the box. OpenCode wins when you need GLM-5.2 today, Copilot subscription reuse, or open-source auditability. Many teams run both — Claude Code for daily Anthropic work, OpenCode for multi-model experiments.
vs Pi
Pi is minimal — you add MCP, sub-agents, and plan mode yourself. OpenCode ships plan/build modes, subagents, LSP, and 75 providers as defaults. Choose Pi to own every line of harness behavior; choose OpenCode to start coding in ten minutes without sacrificing provider choice.
vs Codex
Codex is OpenAI's harness with /goal and OSS mode via Ollama. OpenCode is vendor-neutral with similar AGENTS.md memory and undo semantics. Codex OSS + GLM: Codex Ollama guide.
vs Cursor
Cursor optimizes IDE-native flow. OpenCode optimizes terminal-first + optional desktop with explicit share links and multi-session. Cursor CLI users: compare Cursor slash commands to OpenCode commands.
Loop engineering on OpenCode
OpenCode does not market "loop engineering" the way Pi and Claude Code do, but the same patterns apply:
Deterministic exit — custom /test-until-green command + CI script
Plan before build — Tab to Plan mode for spec-first work
/compact — context engineering when sessions run long
Parallel sessions — one loop per worktree or concern
Commit .opencode/commands/ for /review, /test, /ship
Standardize on AGENTS.md via /init
Use /share for async review of agent sessions
Configuration: opencode.json
OpenCode behavior lives in project or global config (opencode.json with schema at opencode.ai/config.json):
provider — per-provider baseURL, model lists, options (critical for Z.ai Coding Plan endpoints and corporate proxies)
Themes and keybinds — customize TUI without forking
Formatters — wire Prettier, rustfmt, etc. so agent edits match team style
MCP server definitions — attach tools once, reuse across sessions
Credentials from /connect stay in ~/.local/share/opencode/auth.json — separate from repo config so keys never land in Git. For teams, document which providers are approved (Zen only vs BYOK Anthropic vs GLM Coding Plan) in internal runbooks alongside AGENTS.md.
OpenCode Go and Enterprise tiers (listed on opencode.ai) target teams needing managed rollout — check current docs if you are standardizing across hundreds of developers. Individual developers rarely need more than /connect + /init on day one. Power users graduate to custom commands, MCP servers, and Zen spend limits once a single model/provider combo proves stable on real repos.
Summary
OpenCode is the open source, multi-surface coding agent that won 2026 mindshare by combining terminal + desktop + IDE, 75+ LLM providers, auto LSP, parallel sessions, Copilot/ChatGPT OAuth, optional Zen curated models, and a privacy-first local-harness story. It is a complete agent harness — not a thin client — and the harness Matt Pocock's audience keeps picking for GLM-5.2 and Opus-comparable daily driving.