Playbooks · Coding tasks
Use Claude Code login inside OpenCode
Written November 5, 2026 · Edited November 12, 2026
Version 2.2.3 adds a Claude Agent provider that runs on your Claude Code login. What loads, what drops, and the approval question nobody has answered.
What 2.2.3 adds
OpenCode 2.2.3, released October 30, adds a built-in Claude Agent provider. Install Claude Code, run claude auth login, then pick Claude Agent in /connect to use your Claude Code login and models. The OPENCODE_CLAUDE_PATH variable can point OpenCode at the Claude executable when it is not on the normal path. Claude Code must be version 2.1.248 or newer. A subscription, an API key, or a cloud account all work; on a subscription the cost display reads zero because the plan covers usage. Version 2.2.4, later the same day, added a guided setup for the same provider.
What loads, and what drops
Switching to Claude Agent changes what OpenCode loads. Claude Code's own setup stays behind: its settings in ~/.claude and the project's .claude folder, CLAUDE.md files, hooks, MCP servers, and skills are not read, and auto compaction and auto memory are off — OpenCode handles compaction with its own tools. Claude Code's built-in tools are off too; Claude uses OpenCode's tools, and every tool call goes through OpenCode's permission prompts. What carries over is Claude Code's own system prompt, plus OpenCode's instructions from AGENTS.md, skills, MCP instructions, and the selected agent's prompt. Tool calls run one at a time: parallel file reads become sequential.
Several Claude Code features are not available through the provider at all: plan usage tracking, cloud sessions and /teleport, /loop, auto mode, and computer use. /usage in OpenCode shows OpenCode Console usage, not plan usage.
Move your rules to AGENTS.md
With Claude Code's CLAUDE.md loading off, project rules have to come through OpenCode. OpenCode reads AGENTS.md first and falls back to CLAUDE.md only when no AGENTS.md exists, so the fix is to move the rules into AGENTS.md and leave a one-line import in CLAUDE.md. The same file then serves OpenCode, Claude Code, and Codex. MCP servers and hooks need the same treatment: re-add them in OpenCode's own config rather than expecting Claude Code's to load.
The approval question nobody has answered
OpenCode's side: the provider runs the user's installed claude program through Anthropic's Agent SDK and never reads or replays the saved login. The design document puts it plainly: "It never sits between Claude Code and Anthropic or changes Claude Code's requests." OpenCode says it has Anthropic's permission.
Anthropic's side: the Agent SDK overview still says, "Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK." In January, Anthropic tightened safeguards after accounts were banned for triggering abuse filters from third-party harnesses using Claude subscriptions, and in March OpenCode removed its Anthropic OAuth plugin after legal requests. Anthropic has published nothing that names OpenCode's new provider.
Both statements stand as written, and the question is unresolved. Do not assume the arrangement is approved, and do not assume it is forbidden. If your work depends on the subscription surviving inside OpenCode, that uncertainty is part of the decision.
Before you switch
- Copy project rules into AGENTS.md and check OpenCode reads them; a CLAUDE.md alone will not load.
- Re-add the MCP servers and hooks the work needs in OpenCode's config; Claude Code's will not carry over.
- Expect serial tool execution and plan for slower parallel reads.
- Check
/usageexpectations: plan usage is not visible through the provider. - Keep Claude Code installed and signed in on the same machine; the provider does not work in remote workspaces.
Limits
- No setup run is described here. The steps follow the release notes and the provider's design document; whether the switch behaves as described on a given machine depends on that machine's Claude Code version and OpenCode setup.
- The approval question has no public answer from Anthropic. This page states both sides rather than picking one.
- OpenCode moves fast: 2.2.3, 2.2.4, and 2.2.5 all landed on October 30. Check the release notes for the version you install.
Related playbooks
- Move OpenCode 1.x to 2.0 without losing config
- OpenCode 1 offers the upgrade to OpenCode 2
- OpenCode 2.2.6: scripted sessions, clean trees
- OpenCode 2.2.7: Copilot Auto and breaking changes
Sources
- Release v2.2.3 — the Claude Agent provider and its setup steps.
- Add Claude Agent provider (PR #58782) — the provider pull request and its design document.
- Agent SDK overview — the bar on third-party claude.ai login.
- OpenCode Brings Back Claude Subscriptions via the Agent SDK — the design document's dropped list, the January crackdown, and the March legal removal.
- How to Use a Claude Subscription with OpenCode — the 2.2.4 guided setup and the permission claim.
- OpenCode Claude Setup: Claude Agent Subscription Login vs API Key — the dropped list and the AGENTS.md rule.
- Where Claude Code, Codex, Copilot CLI and OpenCode Keep Config, Memory and Logs — AGENTS.md precedence across tools.
Back to: Coding playbooks. Also: Run three independent lines of research at the same time in Claude Code, then combine the short summaries · Agent Skills has a neutral home — and still no security story · Run LongCat-2.5 in Claude Code without the 200K cap · Run MiniMax M3.1 Flash inside Claude Code.