Skip to main content

OpenCode vs Claude Code

OpenCode is an MIT-licensed agent that runs almost any model you connect. Claude Code runs Claude models and ships stricter defaults for what the agent may do.

OpenCode and Claude Code are terminal coding agents. Both read your code, edit files and run commands until a task is done. OpenCode is open source and model-agnostic. Claude Code is Anthropic's agent for Claude. This page covers OpenCode V2, the current release. Facts were checked against each tool's own docs, pricing page and repository in November 2026.

At a Glance​

OpenCodeClaude Code
LicenseMITProprietary
PricingFree. You pay your model provider. Optional OpenCode Go subscription from $10 per monthClaude Pro, Max, Ultra, Team or Enterprise plan, or pay per token through the Claude Console
ModelsProviders from the models.dev catalog, including Anthropic, OpenAI, Google, Amazon Bedrock, Azure, OpenRouter and xAI. ChatGPT Plus or Pro and GitHub Copilot sign-in. Local models through Ollama, LM Studio or vLLM. Any OpenAI-compatible endpoint.Claude models, through Anthropic, Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry
Default permissionsAllows every action except reading .env files, which asksAsks before file edits and non-read-only shell commands
Permission rulesOrdered allow, ask and deny rules per action and path, per agentAllow, ask and deny rules, plus modes such as plan, acceptEdits and auto
OS sandboxNone. Shell commands run with your user's full accessOptional. Seatbelt on macOS, bubblewrap on Linux and WSL2
MCPLocal stdio and remote HTTP servers, with OAuthYes
Project instructionsAGENTS.md onlyCLAUDE.md, or AGENTS.md
Skills and extensionsAgent Skills, plugins, custom agents, custom commandsAgent Skills, plugins, hooks, subagents
Headless and CIopencode runclaude -p, GitHub Actions, GitLab CI/CD
SurfacesTerminal UI, desktop app in beta, web appTerminal, VS Code, JetBrains, desktop app, web
PlatformsmacOS, Windows, LinuxmacOS, Windows, Linux

Models and Cost​

Model choice is the biggest difference. OpenCode reads its provider and model list from models.dev and connects to almost any provider with /connect. You can sign in with a ChatGPT Plus or Pro plan, use a GitHub Copilot account, or point it at a model running on your own machine. OpenCode itself is free.

OpenCode Go is an optional subscription for open coding models that the OpenCode team tests. It costs $10 per month, with Go Plus at $40 per month and Go Teams at $20 per member per month.

Claude Code runs only Claude models. Anthropic lists Pro at $20 per month billed monthly, Max at $100 and Ultra at $200. You can also pay per token with an API key, or bill usage through Amazon Bedrock, Google Cloud or Microsoft Foundry.

If you want to switch models per task or use local models, OpenCode fits. If you only use Claude, Claude Code comes from Anthropic, which also trains the models.

Permissions and Sandboxing​

The defaults point in opposite directions. OpenCode starts every agent with a policy that allows everything, then asks only before reading .env files. You tighten it with ordered allow, ask and deny rules. The last matching rule wins, and a configured deny beats a saved approval.

OpenCode has no OS sandbox. Its docs warn that shell commands run with your user's filesystem, process and network access. Rules match command text, which the docs call best effort, so they recommend a narrow shell allowlist.

Claude Code asks before it edits a file or runs a shell command that is not read-only. It also has an optional OS sandbox. When it is on, shell commands can write only inside the working directory and reach only the network domains you allow.

If you let OpenCode run unattended, run it in a container or a cloud sandbox, or write deny rules first.

Agents, Skills and MCP​

OpenCode ships a build agent with full access and a plan agent that cannot edit your code. Press Tab to switch between them. You can define your own agents with their own prompts, models, tools and permissions.

Claude Code covers the same split with permission modes, including a read-only plan mode. You can also define custom subagents for specific tasks.

Both load skills from SKILL.md folders. OpenCode also reads skills from .claude/skills and ~/.claude/skills, so skills you wrote for Claude Code work there. Both support local and remote MCP servers.

Project instructions do not carry over the same way. OpenCode V2 reads AGENTS.md only and no longer falls back to CLAUDE.md. Claude Code reads CLAUDE.md, or AGENTS.md when that is what a repository has. A single AGENTS.md works for both.

Headless Use​

opencode run "prompt" submits a prompt without the interface, for scripts and CI jobs. OpenCode runs a shared background server that every local client connects to, and --server points a client at another one. claude -p "prompt" is Claude Code's equivalent, and Anthropic ships GitHub Actions and GitLab CI/CD integrations for it.

Which One Suits You​

  • Choose OpenCode if you want open source code, many model providers, local models, or one agent across several subscriptions.
  • Choose Claude Code if you work mostly with Claude models and want prompts and an optional sandbox by default, plus IDE, desktop and browser surfaces.

Running Several Agents at Once​

Because OpenCode runs any model, you can give the same task to one agent per model and keep the best result. That only works when each agent has its own checkout. Git Worktrees for AI covers the manual setup, and Review AI-Generated PRs covers checking the results. Treq gives each agent an isolated workspace and stacks dependent ones.

Next Steps​