Claude Code Compatibility Layers
Relevant source files
The following files were used as context for generating this wiki page:
Claude Code Compatibility Layers represent a critical architectural bridge within the Oh-My-OpenCode project, enabling the integration of Anthropic's Claude models (specifically Opus 4.5 and Sonnet 4.5) into the OpenCode plugin ecosystem. These layers ensure that specialized agents and complex workflows, such as strategic planning and master orchestration, can leverage high-reasoning models while maintaining strict adherence to the project's orchestration and permission protocols.
The system is designed to handle multi-model agent orchestration, supporting not only Claude but also fallback models like GPT-5.2 and Gemini. It provides the necessary hooks, tool restrictions, and prompt templates to allow Claude-based agents like Sisyphus, Atlas, and Prometheus to operate as primary orchestrators and planners within the codebase.
Sources: AGENTS.md:121-125, sisyphus-prompt.md:8-12
Architectural Overview
The compatibility layers function through a tiered system that integrates built-in MCPs (Model Context Protocol), Claude Code compatibility via .mcp.json with variable expansion, and skill-embedded configurations. This architecture allows the project to present a unified interface for different AI models while enforcing specific behavioral constraints through system prompts and hook logic.
The diagram shows the relationship between configuration tiers, the Claude-based agent hierarchy, and the integration with OpenCode.
Sources: AGENTS.md:214-219, AGENTS.md:185-195
Key Compatibility Components
Model Support and Fallback Logic
The project explicitly defines specific roles for Claude models while providing a robust fallback chain to maintain service availability across different LLM providers.
| Agent | Primary Model | Purpose | Fallback Chain |
|---|---|---|---|
| Sisyphus | anthropic/claude-opus-4-5 | Primary orchestrator | Kimi-k2.5 → GLM-4.7 → GPT-5.2-codex → Gemini-3-pro |
| Atlas | anthropic/claude-sonnet-4-5 | Master orchestrator | Kimi-k2.5 → GPT-5.2 |
| Prometheus | anthropic/claude-opus-4-5 | Strategic planning | Kimi-k2.5 → GPT-5.2 |
Sources: AGENTS.md:185-195, src/agents/atlas/gpt.ts:31-35
Implementation of Claude Code Logic
Compatibility is maintained through standardized templates and system prompts that mimic Claude Code's deterministic execution patterns. For instance, the Refactor and Init-Deep commands use multi-phase workflows that include "Discovery," "Analysis," and "Verification" to ensure high-fidelity changes.
- Discovery & Analysis: Uses parallel exploration agents to Predict standard patterns and report deviations.
- Verification: Enforces
lsp_diagnosticsand build/test commands after every delegation.
Sources: src/features/builtin-commands/templates/init-deep.ts:20-30, src/features/builtin-commands/templates/refactor.ts:165-175
Agent Identity and Constraints
Claude-based agents are governed by strict identity constraints to prevent "AI slop" and ensure predictable behavior. This is particularly evident in the Prometheus planner and the Atlas orchestrator.
Prometheus: Strategic Planning Constraints
Prometheus is explicitly restricted from implementation tasks. It operates as a consultant that generates work plans saved to .sisyphus/plans/*.md.
- Forbidden Actions: Writing source code, editing non-markdown files, and running implementation commands.
- Mandatory Outputs: Clarifying questions, research findings, and
.sisyphus/plans/*.mdwork plans.
Sources: src/agents/prometheus/identity-constraints.ts:11-30, src/agents/prometheus/identity-constraints.ts:70-75
Atlas: Orchestration Logic
Atlas acts as a conductor, delegating tasks to "Sisyphus-Junior" or specialized subagents. It follows a mandatory 6-section prompt structure for every delegation to maintain context across stateless subagent calls.
This sequence demonstrates the state management logic used to bridge the gap between stateless Claude subagents.
Sources: src/agents/atlas/gpt.ts:145-160, src/agents/atlas/gpt.ts:175-185
Tooling and Delegation Standards
To ensure compatibility with Claude's reasoning capabilities, the project utilizes a standardized delegation prompt structure. This structure is required for all delegate_task() calls performed by the orchestration layer.
Mandatory 6-Section Prompt
- TASK: Specific, atomic goal quoted from a checkbox.
- EXPECTED OUTCOME: Concrete deliverables and verification commands.
- REQUIRED TOOLS: Explicit whitelist of tools (e.g.,
context7,ast-grep). - MUST DO: Exhaustive requirements and reference files.
- MUST NOT DO: Forbidden actions and scope boundaries.
- CONTEXT: Inherited wisdom from notepads and dependency info.
Sources: src/agents/atlas/gpt.ts:98-125, sisyphus-prompt.md:275-285
Verification Hooks
Compatibility is reinforced by automated verification rules that run after every delegation:
lsp_diagnostics("."): Must return zero errors.Bash("bun run build"): Must exit with code 0.Read: Manual verification of changed files against requirements.
Sources: src/agents/atlas/gpt.ts:187-195, sisyphus-prompt.md:320-330
Summary
The Claude Code Compatibility Layers in Oh-My-OpenCode provide a robust framework for high-reasoning agents to interact with a complex codebase. By combining strict identity constraints for planners (Prometheus), a conductor-style orchestration model (Atlas), and rigorous multi-phase verification (Refactor/Init-Deep), the project ensures that Claude models operate with maximum precision and minimal regression risk.