OpenCode vs Claude Code: A Side-by-Side Comparison
By Tyler Cyert
When choosing a terminal-based coding agent, the opencode vs claude code debate comes up constantly. Both are powerful AI-assisted development tools, but they differ in configuration format, directory structure, and ecosystem features. This guide breaks down every meaningful difference so you can pick the right tool — or build for both.
Short answer: OpenCode uses AGENTS.md and .opencode/ for configuration with support for 75+ model providers. Claude Code uses CLAUDE.md and .claude/ with tighter Anthropic integration, hooks, and agent teams. About 90% of your configuration transfers directly between them.
OpenCode vs Claude Code: Directory Structure Comparison
| Feature | OpenCode | Claude Code |
|---|---|---|
| Config directory | .opencode/ | .claude/ |
| Main instruction file | AGENTS.md (project root) | CLAUDE.md (project root) |
| Personal overrides | — | CLAUDE.local.md (gitignored) |
| Settings file | opencode.json (project root) | .claude/settings.json |
| Agent definitions | .opencode/agents/*.md | .claude/agents/*.md |
| Skills | .opencode/skills/*/SKILL.md | .claude/skills/*/SKILL.md |
| Scoped rules | — | .claude/rules/*.md (path-glob scoping) |
| Lifecycle hooks | — | .claude/hooks/ (event-driven scripts) |
| Custom commands | .opencode/commands/ | — |
| Model support | 75+ providers (provider/model-id) | Anthropic models (sonnet, opus, haiku) |
| Multi-agent | Single-agent | Agent teams (parallel orchestration) |
For a full walkthrough of the Claude Code side, see our guide to the .claude/ directory structure.
AGENTS.md vs CLAUDE.md: The Main Instruction File
Both tools load a markdown file from your project root at the start of every session. The files are functionally identical in purpose — both accept standard markdown, both get loaded automatically, both should be version-controlled.
The differences are minor: AGENTS.md is a single flat file. CLAUDE.md is part of a layered system where you can split scoped instructions into rules and on-demand procedures into skills.
If you are writing your first instruction file, our CLAUDE.md guide and AGENTS.md guide walk through practical templates for each format.
What OpenCode Has That Claude Code Doesn't
- Multi-provider model access. Switch between OpenAI, Google, Anthropic, and dozens more.
- Custom commands. Define reusable command sequences in
.opencode/commands/. - Simpler setup. Fewer moving parts — one instruction file, one config directory.
What Claude Code Has That OpenCode Doesn't
- Scoped rules. Path-glob-based instruction files that only activate when matching files are touched.
- Lifecycle hooks. Scripts triggered by events like PreToolUse, PostToolUse, Stop, and SessionStart.
- Agent teams. Parallel multi-agent orchestration where specialists work simultaneously.
- Local overrides. Both CLAUDE.local.md and settings.local.json for per-developer customization.
When to Choose Which
Choose OpenCode if you want non-Anthropic models, prefer a simpler configuration, or are working solo.
Choose Claude Code if you need lifecycle hooks, scoped rules, team-level config management, or multi-agent orchestration.
Choose both if your system should work regardless of which tool your team uses.
Building for Both Platforms with DotBox
The core of any coding agent configuration — project structure, agent roles, instruction content — is platform-agnostic. Only the file names and directory paths differ. DotBox lets you build your agent configuration visually and export for either platform. The instruction content stays the same — only the scaffolding changes.