The software is free and open-source (MIT). You pay for whichever LLM provider you use:
- OpenCode Zen — pay-as-you-go, fractions of a cent per request. Free models available for learning.
- Direct providers — your own Anthropic/OpenAI/Google/etc. account; pricing is whatever they charge.
- Local models — free if you're running Ollama/LM Studio/llama.cpp on your own hardware.
Both are hosted model access from the OpenCode team — the difference is billing:
- Zen — pay-as-you-go, per-token gateway across the full curated lineup (Anthropic, OpenAI, Google, open models). You pay for exactly what you use.
- Go — a flat $10/month subscription ($5 the first month) to a curated set of hosted open models. Usage limits apply ($12 per 5 hours, $30/week, $60/month equivalent); past the limits it can fall back to a Zen balance.
Reach for Go when you want a predictable monthly bill on open models; reach for Zen when you want per-token access to everything. See opencode.ai/docs/go and ../zen.md.
Briefly: OpenCode is provider-agnostic and open source; Claude Code is Anthropic-only and proprietary.
| OpenCode | Claude Code | |
|---|---|---|
| License | MIT | Proprietary |
| Models | Any provider | Anthropic only |
| Pricing | Pay-as-you-go or BYOK | Subscription |
| Config | opencode.json + .opencode/ |
.claude/settings.json + .claude/ |
| Hooks | JS/TS plugins | Shell commands (often scripts) |
OpenCode reads CLAUDE.md and .claude/skills/ as fallbacks for easier migration.
No. The built-in Anthropic subscription OAuth (the opencode-anthropic-auth plugin) was removed on 2026-03-19 at Anthropic's legal request (PR #18186). Anthropic models still work in OpenCode — use an Anthropic API key (the anthropic provider with apiKey) or route through Zen (opencode/claude-… models).
Yes, if you point it at a local model (Ollama, LM Studio, llama.cpp). Internet access is needed for hosted providers, remote MCP servers, sharing, and updates.
Honest answer: try a few on your actual workload. Benchmarks generalize poorly to specific codebases. Below are starting suggestions, not a ranking — different teams report different winners.
| Task | Reasonable options |
|---|---|
| Day-to-day coding | Claude Sonnet 5 (direct or opencode/claude-sonnet-5, $2/$10), GPT-5.4, Gemini 3.1 Pro |
| Complex multi-file refactors | Claude Fable 5, Claude Opus 4.8, GPT-5.5, GPT-5.5 Pro |
| Fast, lightweight tasks | Claude Haiku 4.5, GPT-5.4 Mini, GPT-5.4 Nano, GLM/Kimi |
| Long-context (>200K tokens) | GPT-5.5 (272K), Gemini 3.1 Pro (>200K tier) |
| Budget-friendly | Qwen3.7 Plus, GPT-5.4 Nano, MiniMax M3 |
| Local / offline | Ollama or LM Studio with a coding-tuned model that fits your hardware (a current Qwen coder or DeepSeek release — quality varies hugely with model size and quantization) |
Use a cheaper model for explore/scout subagents — they read a lot but don't need to write. See ../zen.md for full pricing and the cheap-explorer / strong-executor pattern.
No single model wins every benchmark, and benchmarks don't predict your code. If a model feels wrong, switch — model identity matters more than people often think.
| Type | Path |
|---|---|
| User config | ~/.config/opencode/opencode.json |
| Project config | opencode.json in project root |
| Project assets | .opencode/ in project root |
| Sessions / cache | ~/.local/share/opencode/ (Linux/macOS) |
| Logs | ~/.local/share/opencode/log/ |
| Custom path | Set OPENCODE_CONFIG=<path> |
Configs merge from low to high priority: remote .well-known/opencode → global → custom path → project → .opencode/ → inline env var → managed → macOS MDM.
Commit opencode.json, AGENTS.md, .opencode/agents/, .opencode/commands/, .opencode/skills/, and .opencode/plugins/ to your repo. Every contributor's OpenCode picks them up.
For org-wide defaults, use managed configs (/Library/Application Support/opencode/ on macOS, /etc/opencode/ on Linux, %ProgramData%\opencode on Windows) — they override user config but lose to MDM-pushed configs.
Configure your domain's .well-known/opencode to return JSON. OpenCode fetches it as the lowest-priority config layer — useful for org-wide defaults that users can override.
| You want… | Reach for… |
|---|---|
A /<name> the user types |
Custom command in .opencode/commands/ |
| Workflow the agent discovers when the description matches | Skill in .opencode/skills/<name>/SKILL.md |
| A persistent role with its own model and permissions | Agent in .opencode/agents/<name>.md |
See ../commands.md, ../skills.md, ../agents.md.
Almost always the description is too vague. Skills load when the model decides the description matches the task. Rewrite the description to:
- Start with what it does (verb-first)
- Name the output concretely
- Include a trigger phrase ("Use when…")
Bad: Helps with releases
Good: Draft release notes from merged PRs, propose a semver bump, emit a gh release create command. Use when preparing a tagged release.
Most common culprits:
- Too many MCP tools loaded → run
opencode mcp list, disable noisy ones intools. - Big context →
/compactaggressively. - Slow model → switch to a faster one with
/models. - Watcher choking on large repo → add ignore patterns under
watcher.ignoreinopencode.json.
curl -fsSL https://opencode.ai/install | bash
opencode run --agent plan --format json "audit src/ for security issues" > findings.jsonFor unattended runs, --auto auto-approves anything that isn't explicitly denied — only after auditing what your prompt and tools can do.
Yes:
# Server side
opencode serve --port 4096 --hostname 0.0.0.0
# Client side
opencode attach http://server.local:4096The TUI talks to the remote server. Add --username / --password for basic auth.
opencode stats --days 30 --models # by model
opencode stats --days 30 --tools # by tool
opencode stats --days 30 --project myrepoSee ../migration.md for the full guide. Quick version:
- Rename
CLAUDE.md→AGENTS.md - Move
.claude/commands/→.opencode/commands/ - Move
.claude/skills/→.opencode/skills/ - Rewrite shell-command hooks as JS/TS plugins in
.opencode/plugins/ - Update agent frontmatter — different field names
Yes — reference them from opencode.json:
{
"instructions": [".cursor/rules/*.md", "AGENTS.md"]
}- Local models — nowhere. Code stays on your machine.
- Direct providers — the prompt and edited files go to whichever provider you authenticated with, subject to their policy.
- Zen — Zen is a gateway; the underlying provider's policy still applies, plus Zen's policy for billing/routing. Check opencode.ai/docs/zen for the current statement.
- Sharing (
/share) — opt-in. Shared conversations live on OpenCode's servers until you unshare them.
{ "share": "disabled" }Commit this to opencode.json to enforce it across the team. Enterprise builds can also push this via managed config.
Three layers:
permission.external_directory: "deny"so OpenCode can't read outside the project.- A plugin that blocks
edit/writeto.env*/secrets/paths (see../plugins.md). - Don't commit secrets in the first place.
gitleaksor similar in CI.
Add the install path to your shell:
echo 'export PATH="$HOME/.opencode/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcopencode auth logout
opencode auth login # re-authenticateIf using Zen, regenerate the API key on the dashboard.
opencode mcp debug <server-name>
opencode --log-level DEBUG --print-logsFor OAuth servers, clear creds and re-auth:
opencode mcp logout <server-name>
opencode mcp auth <server-name>OpenCode uses $EDITOR. Set it in your shell:
export EDITOR='code --wait' # VS Code
export EDITOR='nvim' # Neovim- Make sure your terminal supports truecolor. Test:
echo $COLORTERMshould showtruecoloror24bit. - Try a built-in theme:
/themes→ picktokyonightorgruvbox. - Update OpenCode:
opencode upgrade.
github.com/anomalyco/opencode/issues. Include opencode --version, your OS, and a minimal reproduction.
Last reviewed: 2026-07-05 · Canonical source: opencode.ai/docs.