Introduction to OpenCode
What is OpenCode?
OpenCode is an open-source AI coding agent maintained by Anomaly, available in the terminal (TUI), desktop app, and IDE extensions. Unlike single-vendor assistants, OpenCode supports 75+ LLM providers via Models.dev—including Claude, GPT, Gemini, local models, and OpenCode’s own Zen model gateway.
Core value:
- Model-agnostic: one agent workflow; switch providers by changing config
- Privacy-first: official stance is no storage of your code or context (local/self-hosted providers keep data paths under your control)
- LSP integration: connect language servers and feed diagnostics back to the agent
- Parallel sessions: run multiple agent sessions in the same project
- Open source: actively maintained at anomalyco/opencode
Product Matrix
Built-in Agents Overview
OpenCode splits work between Primary Agents and Subagents:
Press Tab to switch Primary agents; invoke Subagents manually with @explore and similar.
Comparison with Codex and Claude Code
When to choose:
- Switch models often or run local LLMs → OpenCode
- Deep OpenAI / ChatGPT stack → Codex
- Deep Anthropic stack → Claude Code
All three support the AGENTS.md open standard; project conventions can be partially reused.
Good Fit / Caveats
Good fit:
- Multi-model comparison and cost tuning (cheap model for Plan, strong model for Build)
- Privacy-sensitive setups (self-hosted providers, local models)
- LSP diagnostics to help the agent fix type/lint errors
- Parallel sessions (e.g. one for frontend, one for API)
Watch out:
- Without API keys and without OpenCode Zen, you must wire up models yourself
- Native Windows support is still maturing; WSL is smoother
- LSP is optional; enabling everything on huge repos may use a lot of memory
Billing and Providers
- OpenCode software is free and open source
- Model usage is billed by your chosen provider (OpenAI, Anthropic, etc.)
- OpenCode Zen: curated model list, connect via
/connect - Some providers may reuse GitHub Copilot, ChatGPT Plus, etc. (check current official support)