Claude Code vs OpenCode comes down to who owns the model connection and what each asks before acting. Claude Code is Anthropic’s agent and, in Manual mode, asks before shell commands and file edits. OpenCode is an MIT-licensed agent that connects to many providers and, per its docs, starts with every action allowed except reads of .env files. Each reads the other’s instruction file, and both run MCP servers, skills and subagents.

Applies to: Claude Code docs (AGENTS.md reading needs v2.1.277 or later) and OpenCode 2 docs, both read on December 1, 2026. Last checked: December 1, 2026.

On this page

What each one is

Claude Code OpenCode
Made by Anthropic OpenCode, an open source project
Where it runs Terminal, IDE extensions, desktop app and browser (overview) Terminal, desktop app and web app (intro)
License “All rights reserved”, use subject to Anthropic’s Commercial Terms (LICENSE.md) MIT (LICENSE)
Install curl -fsSL https://claude.ai/install.sh | bash curl -fsSL https://opencode.ai/v2/install | bash
Sign-in Claude subscription or Anthropic Console account; third-party providers are supported in the terminal CLI, VS Code and JetBrains (overview) /connect in the TUI, then /models; the catalog comes from models.dev (providers)

OpenCode’s install page also lists npm install -g @opencode/cli and brew install anomalyco/tap/opencode-v2, and says the mise route needs mise 2026.10.9 or later because older versions install OpenCode 1 (intro). That matters when you follow an older tutorial: OpenCode’s permissions page warns that V1 uses different field and action names, so permission and bash become permissions and shell in V2 (permissions).

For the plan and billing side, OpenCode documents a /connect sign-in with a ChatGPT Plus or Pro plan, GitHub Copilot device login and OpenCode Go, a $10 per month subscription (providers, intro). See OpenCode Go and OpenCode free models for those two.

Permissions: the difference that matters

Claude Code’s permission table says that in Manual mode a Bash command needs approval except a built-in set of read-only commands, a file edit needs approval, and web fetches and searches ask except for preapproved documentation domains (permissions). OpenCode works the other way round. Its docs say every agent, custom ones included, starts with a base policy that allows every action, with reads of .env and .env.* files set to ask and .env.example allowed (permissions). The shipped Build agent adds only an allow for questions, and the Plan agent denies edits except to its plan files.

Warning

OpenCode’s own docs say that shell “runs with the host user’s filesystem, process, and network authority”, and that reads and edits outside the project proceed without a prompt unless you add an external_directory rule (permissions). Anthropic’s matching warning is for bypassPermissions, which skips prompts and should only be used “in isolated environments like containers or VMs” (permissions). Do not run either tool unattended on a machine that holds credentials you cannot lose.

To make OpenCode ask before shell commands, allow routine Git inspection and block pushes, the docs give these ordered rules for opencode.jsonc. The last matching rule wins, so the exceptions come after the broad rule (permissions):

{
  "$schema": "https://opencode.ai/config.json",
  "permissions": [
    { "action": "shell", "resource": "*", "effect": "ask" },
    { "action": "shell", "resource": "git status *", "effect": "allow" },
    { "action": "shell", "resource": "git diff *", "effect": "allow" },
    { "action": "shell", "resource": "git push *", "effect": "deny" }
  ]
}

The Claude Code equivalent is an allow and deny list in a settings file. This example is from Anthropic’s docs and allows npm scripts and commits while refusing git push; a push written another way, such as git -C . push, is not matched, as the same page notes (permissions):

{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git commit *)"
    ],
    "deny": [
      "Bash(git push *)"
    ]
  }
}

Both have a read-only planning mode. In Claude Code, plan mode reads files and runs read-only shell commands without editing source, and Shift+Tab cycles the permission modes (permissions, modes). In OpenCode, Shift+Tab cycles agents, and Plan is one of the two built-in primary agents beside Build (TUI, agents). More on Claude Code’s rules: Claude Code permissions.

Instruction files: each reads the other’s

Claude Code OpenCode
Main file CLAUDE.md in the project or .claude/CLAUDE.md; ~/.claude/CLAUDE.md for you (memory) AGENTS.md; ~/.config/opencode/AGENTS.md for you (rules)
Reads the other tool’s file Reads AGENTS.md when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it Reads CLAUDE.md in any directory without an AGENTS.md, and ~/.claude/CLAUDE.md when there is no global AGENTS.md
Both present Reads CLAUDE.md only, unless you set Project instructions to claude-md-and-agents-md in /config AGENTS.md wins over CLAUDE.md in the same directory
Turn the fallback off claude-md setting OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 skips every CLAUDE.md; OPENCODE_DISABLE_CLAUDE_CODE=1 also skips .claude skills

Sources: Claude Code memory docs and OpenCode instructions docs. Anthropic notes that a CLAUDE.local.md counts as a CLAUDE.md for this check, so adding one to a repository that relies on AGENTS.md stops Claude Code from reading AGENTS.md for you unless you change the setting. OpenCode also takes an instructions array in its config for extra files, globs and URLs. A repository with one AGENTS.md therefore works in both tools; see CLAUDE.md vs AGENTS.md for the wider picture.

MCP servers

Anthropic and OpenCode both document adding a remote server from the command line. These are their own examples:

claude mcp add --transport http notion https://mcp.notion.com/mcp
opencode mcp add context7 --url https://mcp.context7.com/mcp

For a local stdio server, Claude Code uses claude mcp add [options] <name> -- <command> [args...] (MCP docs) and OpenCode uses opencode mcp add everything -- npx -y @modelcontextprotocol/server-everything (MCP docs). Two differences from the docs:

  • Where it is saved. OpenCode writes to the project configuration, or to the global one with --global. Claude Code takes --scope project to put a server in .mcp.json at the project root for the team (Claude Code MCP).
  • Config shape. In OpenCode V2, servers sit under mcp.servers, each with "type": "local" and a command array, or "type": "remote" and a url; server names do not go directly under mcp. OpenCode connects remote servers with OAuth by default, and you sign in to one that needs authentication from /mcps (MCP docs).

OpenCode’s docs add that MCP tools consume model context, so add only the servers you need. The same advice fits Claude Code. For the Claude Code side, see Claude Code MCP.

Skills and subagents

Claude Code OpenCode
Skill file SKILL.md in a skill folder under .claude/skills/ or ~/.claude/skills/ (skills) SKILL.md in .opencode/skills/<skill-id>/ or ~/.config/opencode/skills (skills)
Also reads .claude/skills, ~/.claude/skills, .agents/skills and ~/.agents/skills
Subagent files .claude/agents/ or ~/.claude/agents/ (subagents) .opencode/agents/<name>.md or ~/.config/opencode/agents/<name>.md (agents)
Built-in agents Described in the subagents docs Build, Plan (primary), General and Explore (subagents)

An existing .claude/skills/ folder therefore works in OpenCode without a copy. The reverse is not documented: Anthropic’s skills page lists its own locations only. OpenCode’s subagent frontmatter takes description, mode: subagent and a permissions list, and its docs say subagents run in child sessions and always in the background (agents).

Scripts and CI

Both run without the interactive screen. Anthropic’s headless example is claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash" (headless). OpenCode’s is opencode run "Explain this repository", described as designed for scripts and CI jobs (CLI). In a non-interactive OpenCode run, the docs say each client decides how to handle an approval request while configured deny rules always stay enforced (permissions), so write deny rules before you put it in a pipeline.

Using Claude Code inside OpenCode

OpenCode documents a Claude Agent provider that runs Claude Code on your machine and uses its login. You sign in with claude auth login (Claude Code 2.1.248 or later), then pick Claude Agent in /connect and a model in /models (Claude Agent). According to that page, Claude Code calls the model and OpenCode does the rest: Claude uses OpenCode’s tools and permissions, and your Claude Code settings, CLAUDE.md files, hooks, MCP servers, skills and memory are not loaded. It also says that with a Claude subscription login the cost shown is none because your plan covers it. What your subscription allows is set by Anthropic’s terms for your plan, so check those first.

Which one fits

Based only on what the two sets of docs show:

  • You want prompts by default and one vendor’s settings system. Claude Code asks before shell commands and edits in Manual mode, and has managed settings for organizations, described in Anthropic’s docs.
  • You want to pick the provider. OpenCode lists a models.dev catalog, ChatGPT plan sign-in, Copilot login and its own Go plan, and you decide per agent which model runs.
  • You use both on one repository. Keep one AGENTS.md, keep shared skills in .claude/skills/, and add the ask and deny rules above to OpenCode first.

This page compares documented behaviour. It does not rank output quality, speed or model results, which the docs do not settle.