Installation
Output Structure
Global Installation
Writes to~/.config/opencode/:
Project Installation
Writes to.opencode/ in your project:
Commands are written as individual
.md files rather than entries in opencode.json. OpenCode resolves commands by filename at runtime.Configuration Merging
The converter uses deep-merge logic (ADR-002):- Existing user config always wins on conflict
- Plugin MCP servers are added, but existing entries are preserved
- Permissions and tools are merged with user preferences taking precedence
- A backup is created before overwriting
opencode.json
Conversion Details
Agents
Converted to.md files with YAML frontmatter:
description: Agent descriptionmode:primaryorsubagent(from conversion options)model: Normalized model name with provider prefixtemperature: Inferred from agent name/description (optional)
Commands
Converted to.md files in ~/.config/opencode/commands/:
Commands with
disableModelInvocation: true are skipped during conversion.Skills
Skill directories are symlinked (not copied) from the plugin:MCP Servers
Both stdio and remote MCP servers are supported:Hooks
Claude hooks are converted to OpenCode plugin format:| Claude Hook | OpenCode Event | Notes |
|---|---|---|
PreToolUse | tool.execute.before | Before tool execution |
PostToolUse | tool.execute.after | After successful execution |
PostToolUseFailure | tool.execute.after | When input.error exists |
SessionStart | session.created | New conversation |
SessionEnd | session.deleted | Conversation ended |
PermissionRequest | permission.requested, permission.replied | Permission prompts |
Tool Name Mapping
Claude tool names map directly to OpenCode:| Claude | OpenCode |
|---|---|
Bash | bash |
Read | read |
Write | write |
Edit | edit |
Grep | grep |
Glob | glob |
WebFetch | webfetch |
Task | task |
Path Rewriting
Claude-specific paths are rewritten:~/.claude/→~/.config/opencode/.claude/→.opencode/
Permission Modes
The converter supports three permission modes:none (default)
No permissions added to config.
broad
All tools allowed:
from-commands
Derived from allowedTools in commands:
Model Normalization
Bare model aliases are converted to provider-prefixed names:| Input | Output |
|---|---|
haiku | anthropic/claude-haiku-4-5 |
sonnet | anthropic/claude-sonnet-4-5 |
opus | anthropic/claude-opus-4-6 |
claude-3-5-sonnet | anthropic/claude-3-5-sonnet |
gpt-4 | openai/gpt-4 |
gemini-pro | google/gemini-pro |
Temperature Inference
WheninferTemperature: true, the converter analyzes agent names and descriptions:
| Pattern | Temperature |
|---|---|
| review, audit, security, sentinel | 0.1 |
| plan, architecture, analysis | 0.2 |
| doc, readme, changelog | 0.3 |
| brainstorm, creative, design | 0.6 |
| Default | 0.3 |
Example Output
Input (Claude plugin):~/.config/opencode/agents/plan-specialist.md):
Limitations
- Commands with
disableModelInvocation: trueare not converted - Hook matchers with wildcards (
*) apply to all tools in OpenCode - Unmapped hook events are commented out in the generated plugin
See Also
OpenCode Config Schema
Official schema for opencode.json
Sync Command
Sync personal Claude config to OpenCode