A new plugin by developer Khalil Gharbaoui allows users to run Anthropic's Claude Code inside the OpenCode environment by leveraging the official CLI rather than direct API calls. The tool, hosted on GitHub as opencode-claude-code-plugin, functions as a subprocess bridge that respects existing authentication states, including Claude subscriptions, API keys, Bedrock, or Vertex credentials. This approach distinguishes it from proxy-style plugins that lift OAuth sessions out of the official client, a practice Anthropic explicitly disallowed for third-party use in February 2026.
Architectural Compliance and Security
The plugin's core value proposition is structural compliance with Anthropic's terms of service. It never reads, stores, or replays tokens; instead, it inherits whatever authentication the official claude CLI is currently logged in with. This method ensures that billing remains accurate, drawing from plan limits for subscriptions or pay-as-you-go rates for API keys. The plugin also includes a safety check that warns users if a stray ANTHROPIC_API_KEY environment variable might inadvertently shift their billing model, providing transparency via the CLI's apiKeySource status.
Tool Proxying and Execution Control
By default, the plugin proxies critical tools such as Bash, Edit, Write, WebFetch, and Task back to OpenCode. This means that while Claude generates the intent, OpenCode executes the actions under its own permission prompts and audit logs, maintaining local security controls. Conversely, tools like Read, Grep, and Glob run natively within the Claude Code subprocess. The system supports selective tool proxying, allowing developers to decide on a per-tool basis whether execution occurs in Claude Code or is handled by the OpenCode host, with proxied calls ending on specific events rather than arbitrary timeouts.
Multi-Account Support and Model Access
The plugin supports multiple Claude accounts, allowing users to configure distinct providers for personal and work environments within a single OpenCode instance. If one account hits usage limits mid-task, the system can identify the active account, display reset times in the user's local time zone, and facilitate switching to another account. It exposes the full range of Claude models, from Haiku 4.5 to Opus 5.5, including reasoning variants and fast modes, with list-price suffixes visible in the model picker. Features like /btw allow side questions to be answered by the running Claude session, while /claude-code-doctor provides a redacted health report for troubleshooting.
Key Takeaways
- The plugin uses the official
claudeCLI as a subprocess to avoid violating Anthropic's February 2026 ban on OAuth session reuse. - Billing is transparent, inheriting the authentication source (subscription vs. API key) directly from the CLI without token manipulation.
- Tool execution is hybrid: file-system tools like Bash and Edit are proxied to OpenCode for security, while search tools run in Claude Code.
- Multi-account support allows seamless switching between personal and work profiles when usage limits are reached.
- The plugin is compatible with both OpenCode 1.x and 2.x, with a single package serving both versions.
The Bottom Line
This plugin is a necessary evolution for OpenCode users who want Claude's reasoning without the legal or billing risks of API proxies. It respects Anthropic's boundaries while keeping local execution control in the developer's hands.