What is the difference between OpenCode and Claude Code?
OpenCode is an open source coding agent that works with many model providers; Claude Code is Anthropic's coding agent and runs on Claude models. Both run in the terminal, read your code, edit files and run commands. They differ most in model choice, pricing, default permissions and which instruction files they read.
The short version: pick Claude Code for a single subscription and Anthropic's models with built-in safety checks. Pick OpenCode if you want open source code, your choice of models, and a tool that already reads your .claude/skills folder.
How does OpenCode work?
OpenCode's V2 docs say: "OpenCode is an open source AI coding agent. It's available as a terminal-based interface, desktop app, or web app." The anomalyco/opencode repo is MIT licensed.
Install it with the script or a package manager:
curl -fsSL https://opencode.ai/v2/install | bash
# or
npm install -g @opencode/cli
The V2 docs note that "Windows package managers are not supported." OpenCode's docs also warn that OpenCode 1 and OpenCode 2 both use the opencode command and can conflict, so check which version you have before installing.
Key pieces:
- Models. OpenCode "includes a provider and model catalog from models.dev." You connect a provider in the terminal UI with
/connect. It discovers local models from Ollama, LM Studio and vLLM, and its providers page documents GitHub Copilot sign-in and using "a ChatGPT Plus or Pro plan instead of an OpenAI API key." - Agents. Two primary agents: Build, the "Default coding agent," and Plan, which "Explores and plans without editing normal project files." Two subagents, General and Explore, handle research. You can define your own in
.opencode/agents/<name>.md. - Undo. Snapshots "let you undo recent conversation and file changes together" with
/undoand/redo. They don't reverse shell command side effects, and outside a Git repo they roll back only the conversation. - Web access. Run
opencode pairand open the one-time link it prints to use a session from a browser.
How does Claude Code work?
Claude Code is "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools," per Anthropic's overview. It runs in the terminal, in VS Code and Cursor, in JetBrains IDEs, in a desktop app and at claude.ai/code.
Key pieces:
- Models. Claude only. The default on paid plans and the Anthropic API is Opus 5.5, per the model configuration docs. Switch with
/model. - Permissions. Six permission modes. On v2.1.283 or later, interactive terminal and VS Code sessions start in
auto, where a classifier reviews actions instead of you. Manual mode "stops and asks you before most actions that edit files, run shell commands, or reach the network."planmode is for reading and planning first. - Undo. Checkpoints you roll back with
/rewind. - Customization. CLAUDE.md, skills, hooks, subagents, MCP servers and plugins, plus
claude -pand GitHub Actions for automation.
OpenCode vs Claude Code side by side
| OpenCode | Claude Code | |
|---|---|---|
| License | Open source, MIT | Anthropic product |
| Models | Many providers via models.dev, plus local models | Anthropic's Claude models |
| Where it runs | Terminal UI, desktop app, web via opencode pair |
Terminal, VS Code and Cursor, JetBrains, desktop app, web |
| How you pay | Your provider account, or OpenCode Go | Paid Claude plan, or Claude Console per token |
| Default permissions | Most actions allowed; asks for .env reads |
Auto mode, where a classifier reviews actions; Manual mode asks before edits, commands and network |
| Planning | Plan agent | plan permission mode |
| Project instructions | AGENTS.md only |
CLAUDE.md, or AGENTS.md when there is no CLAUDE.md |
Skills (SKILL.md) |
.opencode/skills, .claude/skills, .agents/skills |
.claude/skills, ~/.claude/skills |
| Custom commands | .opencode/commands/*.md |
Skills, or older .claude/commands/*.md |
| MCP | Yes, under mcp.servers |
Yes, claude mcp add or .mcp.json |
| Undo | /undo, /redo snapshots |
/rewind checkpoints |
How do pricing and model access compare?
OpenCode has no charge for the agent. You pay for models. Use an API key from a provider, sign in with a supported subscription such as ChatGPT Plus or Pro, run local models, or subscribe to OpenCode Go. As of October 2026, Go is $10 a month and Go Plus is $40 a month, both giving access to a set of "popular open coding models," with usage limits defined as monthly dollar amounts.
Claude Code comes with paid Claude plans. As of October 2026, claude.com/pricing lists Pro at $20 a month ($17 a month billed annually) and Max from $100 a month, and the free plan does not include Claude Code. A Claude Console account bills per token.
If you want Claude models in OpenCode, note that its providers page documents a ChatGPT subscription sign-in but no Claude subscription sign-in. Anthropic is in the catalog, so expect API billing for Claude there.
How do permissions compare?
This is the biggest day-to-day difference, and it is worth knowing before your first session.
OpenCode's permissions docs say every agent starts with a base policy whose first rule allows every action. Reads of .env files default to ask, and "If no rule matches, OpenCode uses ask." You tighten it with an ordered permissions array in opencode.jsonc, where the last matching rule wins:
{
"permissions": [
{ "action": "shell", "resource": "*", "effect": "ask" },
{ "action": "shell", "resource": "git status *", "effect": "allow" },
{ "action": "shell", "resource": "git push *", "effect": "deny" }
]
}
Claude Code adds a reviewer instead. Its starting mode in the terminal and VS Code is auto, which runs "Everything, with background safety checks," while claude -p scripts start in Manual mode. Switch to Manual to approve each action yourself, or use allow rules and acceptEdits to tune it. The Claude Code permissions guide covers rules and modes.
Neither approach is wrong. Start OpenCode on a clean branch or add ask rules if you want prompts; in Claude Code, pick Manual mode when you want to approve every step.
How do instructions, skills and commands compare?
Instructions. OpenCode's instructions page is direct: "OpenCode V2 recognizes AGENTS.md only." It loads a global ~/.config/opencode/AGENTS.md and then every AGENTS.md from the current workspace up toward your home directory, and it "does not use CLAUDE.md as a fallback." Claude Code reads CLAUDE.md, and reads AGENTS.md in its place when no CLAUDE.md exists. To share one file, keep your rules in AGENTS.md and add @AGENTS.md to the top of CLAUDE.md.
Skills. OpenCode scans .opencode/skills, .claude/skills and .agents/skills in the project, plus the matching global folders. So skills you built for Claude Code in .claude/skills/ work in OpenCode as they are. The model loads a skill with its skill tool, and you can load one yourself by writing @skill-id in your prompt. In Claude Code you type /skill-name.
Commands. OpenCode keeps custom commands separate, in .opencode/commands/ or ~/.config/opencode/commands/, with $ARGUMENTS and $1 placeholders. Claude Code merged custom commands into skills; see skills vs slash commands.
Which should you pick?
Pick OpenCode if:
- You want open source code you can read, fork and audit.
- You want to choose and switch models, including local or open weight ones.
- You already pay for ChatGPT Plus or Pro or GitHub Copilot and want to use that access.
- You like a permissive default and prefer adding rules where you want prompts.
Pick Claude Code if:
- You want Anthropic's Claude models with no provider setup.
- You already have a Claude Pro, Max or Team plan.
- You want actions reviewed by default, with a Manual mode that asks before each edit or command.
- You want the same agent across terminal, IDE, desktop and browser, with CI integrations.
You can also run both. Keep shared rules in AGENTS.md and skills in .claude/skills/, and both tools pick them up.
Keep your skills in a repo you own
Since OpenCode reads .claude/skills, one skill library can serve both agents. Kipt keeps your prompts and skills as Markdown in a private GitHub repo, and npx skills add https://github.com/<you>/<repo>.git --all -g installs every skill into Claude Code or Codex. The free SKILL.md generator turns a prompt into a skill folder in your browser.