← Back to news
ZBuild NewsUpdated

OpenCode Blocked by Anthropic: What Happened, Why, and How Developers Are Responding in 2026

A comprehensive breakdown of Anthropic blocking OpenCode from accessing Claude models in 2026. Learn what triggered the ban, the legal and technical details, community reactions from DHH and others, available workarounds, and what this means for the future of open-source AI coding tools.

Published
2026-03-27T00:00:00.000Z
Author
ZBuild Team
Reading Time
15 min read
opencode blocked anthropicopencode bananthropic block opencodeopencode claude blockedanthropic ToS updateopencode workaround
OpenCode Blocked by Anthropic: What Happened, Why, and How Developers Are Responding in 2026
ZBuild Teamen
XLinkedIn

The Short Version

In January 2026, Anthropic blocked OpenCode and every other third-party AI coding tool from accessing Claude models through subscription-based OAuth. The move disrupted hundreds of thousands of developers, triggered backlash from prominent figures like DHH, and led OpenAI to publicly partner with OpenCode as a competitive countermove. Here is the full story, the technical details, and your options going forward.

October 2026 Update: What Has Changed Since

The block itself still stands: OpenCode cannot sign in with a Claude Pro or Max subscription, and its docs say plainly that "Anthropic explicitly prohibits this" (OpenCode providers docs). But Anthropic's rules around it have moved several times.

DateWhat happenedSource
Jan 8–9, 2026Anthropic "tightened our safeguards against spoofing the Claude Code harness"Anthropic's Thariq Shihipar on X
Jan 9, 2026OpenCode merges ChatGPT (Codex) sign-in supportOpenCode commits
By Feb 18, 2026Claude Code legal docs add "Authentication and credential use", banning subscription tokens in any other product, "including the Agent SDK"Archived copy
Mar 19, 2026OpenCode removes its built-in Claude login plugin "per legal requests" (PR #18186); v1.3.0 ships Mar 22PR #18186
May 13, 2026Anthropic announces that Agent SDK and third-party app usage will move off subscription limits onto a monthly credit from June 15Archived support article
Jun 15, 2026Change paused: "Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription limits"Anthropic support
Aug–Oct 2026Legal docs now explicitly allow "an end user … signing in to the unmodified Claude Code binary with their own Claude subscription, including where a platform hosts Claude Code"Claude Code legal docs
Oct 7, 2026Max and Team plans get monthly API credits ($100–$200 for Max; $20 or $100 per Team seat, pooled up to $500)Anthropic support
Oct 10, 2026Amp lets users run their Claude Pro/Max plan inside Amp, using the official Claude Agent SDK and Claude CodeAmp

The rule today, in short (Claude Code legal docs):

  • Not allowed: a third-party tool offering Claude.ai login, or collecting, storing or relaying your Claude credentials or session tokens. This is what OpenCode's old plugin did, and what most subscription proxies do.
  • Allowed: you signing in, through Anthropic's own flow, to the unmodified Claude Code binary, even when another product runs it for you. Amp's Claude Code mode and Cline's "Claude Code" provider (Cline docs) work this way.
  • Always allowed: using Claude through an Anthropic API key or a cloud provider such as Bedrock or Vertex, in any tool, including OpenCode.

If you want a different agent but your own Claude subscription, use one that drives the official Claude Code. If you want OpenCode specifically, use an Anthropic API key, or a subscription OpenCode supports directly: ChatGPT Plus, GitHub Copilot or GitLab Duo.

The rest of this article is the original March 2026 breakdown, with dates corrected where primary sources disagree with early press reports.


OpenCode Blocked by Anthropic: The Complete 2026 Breakdown

If you woke up one morning in January 2026 and found your OpenCode-Claude workflow suddenly dead, you were not alone. Anthropic deployed server-side blocks that cut off OpenCode — the open-source AI coding agent (now 212,000+ GitHub stars) — from accessing Claude models through subscription OAuth tokens. What followed was one of the most significant developer trust incidents in the AI tooling space.

This article covers everything: the timeline, the technical mechanisms, the legal escalation, community reactions, available workarounds, and what this episode means for the future of AI-assisted development.


Part 1: Timeline of Events

Phase 1 — The Quiet Block (January 9, 2026)

On January 9, 2026, Anthropic deployed server-side checks that began rejecting OAuth tokens from third-party tools. Developers using OpenCode's /connect command to authenticate with their Claude Pro or Max accounts started hitting a wall. The error message was unambiguous:

Error: This credential is only authorized for use with Claude Code
and cannot be used for other API requests.

Source

At first, many developers assumed it was a bug. GitHub issues piled up in the OpenCode repository, with users reporting that their previously working setups had broken overnight. The OpenCode maintainers confirmed the change was deliberate on Anthropic's part.

Phase 2 — Technical Escalation (January–February 2026)

Anthropic did not stop at simple token validation. Over the following weeks, they implemented increasingly sophisticated detection mechanisms:

  • Client fingerprinting: Server-side checks that identified whether a request originated from a genuine Claude Code client or a third-party tool spoofing the same OAuth flow
  • User-Agent validation: Requests without the expected Claude Code user-agent string were flagged and rejected
  • Behavioral analysis: Patterns of API usage that deviated from typical Claude Code interaction patterns triggered blocks

Each time the OpenCode community found a workaround, Anthropic deployed a countermeasure. This cat-and-mouse dynamic played out across multiple GitHub issues, including #6930 and #10956.

Phase 3 — Legal Formalization (February 2026)

In February 2026, Anthropic added an explicit "Authentication and credential use" section to the Claude Code legal docs. An archived copy shows it live by February 18; press reported it on February 19–20. The key clause stated:

Using OAuth tokens obtained through Claude Free, Pro, or Max accounts in any other product, tool, or service — including the Agent SDK — is not permitted and constitutes a violation of the Consumer Terms of Service.

Archived source. Anthropic later rewrote this section; see the October 2026 update above.

This transformed what had been a technical enforcement action into formal policy. OpenCode removed its built-in Claude login on March 19, 2026, in a pull request titled "anthropic legal requests" (PR #18186). Some early reports dated the removal to February; the git history shows March.

Phase 4 — The OpenAI Countermove (February–March 2026)

OpenCode merged ChatGPT sign-in support on January 9, 2026, the same day the block became public (commit history). Press described an OpenAI partnership with OpenCode and other open-source tools (report); we found no formal partnership announcement from OpenAI itself. Either way, the effect was clear: ChatGPT subscriptions work in OpenCode, and Claude subscriptions do not.


Part 2: Why Anthropic Did It

Understanding Anthropic's motivations requires looking at the business dynamics at play.

Revenue Protection

Claude Pro costs $20/month and Claude Max costs $100–200/month. These subscriptions include generous usage limits intended for Claude Code, Anthropic's own terminal-based coding tool. When OpenCode users authenticated via OAuth, they accessed the same Claude models at subscription rates rather than paying per-token API prices, which are significantly higher for heavy usage.

For Anthropic, every developer using Claude through OpenCode instead of Claude Code represented either lost API revenue or increased infrastructure costs without corresponding revenue from their own product.

Product Strategy

Claude Code is a core part of Anthropic's developer strategy. By restricting model access to their own client, Anthropic maintains control over the user experience, collects usage data for model improvement, and positions Claude Code as the definitive way to use Claude for coding.

Terms of Service Justification

From Anthropic's perspective, the OAuth flow was designed specifically for Claude Code. Third-party tools that replicated this flow — having users log in via browser and receiving OAuth tokens — were using an authentication mechanism outside its intended scope. The ToS update codified what Anthropic argued was always the intent.


Part 3: Community Backlash

The developer community response was swift and overwhelmingly negative.

DHH's Criticism

David Heinemeier Hansson (DHH), the creator of Ruby on Rails and CTO of 37signals, was among the most vocal critics. He posted on X:

"Confirmation that Anthropic is intentionally blocking OpenCode, and any other 3P harness, in a paranoid attempt to force devs into Claude Code. Terrible policy for a company built on training models on our code, our writing, our everything. Please change the terms, @DarioAmodei."

Source

DHH's critique captured a sentiment shared by many: Anthropic trained its models on open-source code, but was now preventing open-source tools from accessing those models.

The "Walled Garden" Debate

Developer Patrick O'Doherty published an influential piece titled "Anthropic's Walled Garden: The Claude Code Crackdown," arguing that Anthropic was building a closed ecosystem that contradicted the open ethos of the developer community it depended on. Source

GitHub Star Surge

Paradoxically, the controversy was the best thing that ever happened to OpenCode's growth metrics. The project gained 18,000 new GitHub stars in two weeks following the block, as developers rallied around the project out of principle. By March 2026, OpenCode had reached 126,000+ stars and 800+ contributors.

Hacker News Threads

Multiple Hacker News threads on the topic drew hundreds of comments, with the dominant sentiment criticizing Anthropic's approach. The thread "Anthropic Explicitly Blocking OpenCode" and "Anthropic takes legal action against OpenCode" both reached the front page.


Part 4: The Technical Details

How the OAuth Flow Worked (Before the Block)

Before the ban, here is how OpenCode accessed Claude:

  1. User runs /connect in the OpenCode TUI
  2. OpenCode opens a browser window pointed at Anthropic's OAuth endpoint
  3. User logs in with their Anthropic account (Pro or Max)
  4. Browser redirects back with an OAuth token
  5. OpenCode stores the token locally and uses it for API requests
  6. Anthropic's API serves Claude responses as if they came from Claude Code

This flow was functionally identical to what Claude Code itself does. The difference was the client making the requests.

How the Block Works

Anthropic's blocking mechanism operates at multiple levels:

Request from client
    │
    ├─ Check OAuth token origin ──→ Reject if not Claude Code
    │
    ├─ Validate client fingerprint ──→ Reject if spoofed
    │
    ├─ Analyze user-agent header ──→ Flag non-Claude-Code clients
    │
    └─ Behavioral pattern matching ──→ Block anomalous usage

The fingerprinting is the most sophisticated element. Anthropic's servers analyze characteristics of each request that are difficult for third-party tools to replicate, including internal headers, request timing patterns, and session metadata that Claude Code generates.

Subscription OAuth vs. API Keys

It is critical to understand the distinction:

Access MethodStatusCost Model
Claude Pro/Max OAuth (via third-party)BlockedSubscription ($20–200/mo)
Claude Code OAuth (official client)WorksSubscription ($20–200/mo)
Anthropic API keyWorks with OpenCodePay-per-token

Using the Anthropic API with a paid API key in OpenCode is fully compliant with Anthropic's terms. The block only applies to subscription OAuth tokens used outside Claude Code.


Part 5: Working Solutions (March 2026)

Despite the restrictions, developers have several legitimate paths forward.

Solution 1: Anthropic API Key (Fully Compliant)

The most straightforward and ToS-compliant approach is to use the Anthropic API directly:

# Set your API key
export ANTHROPIC_API_KEY=sk-ant-xxxxx

# Configure OpenCode to use the Anthropic provider
# In your opencode.json
{
  "provider": {
    "anthropic": {
      "model": "claude-sonnet-4-6"
    }
  }
}

Cost: Pay-per-token pricing. For heavy coding use, this can be $50–200+/month depending on volume, making it comparable to or more expensive than a subscription. But it works, and it is fully within Anthropic's terms.

Source

Solution 2: OpenAI with Codex Subscription

OpenCode's docs list ChatGPT Plus, GitHub Copilot and GitLab Duo as subscriptions you can use "with zero setup" (OpenCode providers docs). Sign in to one of them from OpenCode's provider login, or use an OpenAI API key. This is the option many developers migrated to.

Solution 3: Proxy Tools (Use With Caution)

Several community-built proxy tools bridge Claude Max subscriptions to local API endpoints:

  • Meridian: Turns your Claude Max subscription into a local Anthropic API. The proxy authenticates through your Claude Max session rather than API keys. Source
  • Anthropic Auth plugins: Community-maintained OAuth authentication plugins for OpenCode. Source

Important caveat (updated October 2026): Anthropic's current terms say developers "may not collect, store, or intermediate Claude.ai credentials or session tokens — sign-in to a Claude account must complete through Anthropic's own flow" (legal docs). A proxy that relays your subscription token breaks that rule, and Anthropic says it may enforce "without prior notice". The compliant alternative is a tool that runs the unmodified Claude Code binary with your own sign-in, such as Amp's Claude Code mode or Cline's Claude Code provider.

Solution 4: Alternative Models

OpenCode supports 75+ LLM providers. You can switch to:

  • Google Gemini 3.1 Pro — Google's current Pro model, via API key
  • DeepSeek V4 — Cost-effective, open weights
  • Local models via Ollama — Fully offline, zero cost, no ToS concerns
  • Mistral Codestral — Purpose-built for code, competitive performance

Solution 5: Use a Platform That Does Not Lock You In

If you are building applications rather than writing code in a terminal, consider an AI app builder like ZBuild (our product): you describe the app in plain language, plan it with the AI, and the AI builds a full-stack web app (frontend, backend and database) with a live preview that you keep improving by chat. You never manage model providers or API keys, so a provider changing its terms is not your problem.


Part 6: Impact on the Broader Ecosystem

The Open vs. Closed Divide

This incident crystallized a fundamental tension in the AI tooling space. On one side: companies that trained models on open-source code and community-generated content. On the other: the open-source community that produced that training data and now wants unrestricted access to the resulting models.

The argument resonated because it touched a nerve about reciprocity. Anthropic's models were trained on billions of lines of open-source code. Many developers feel that restricting how they access those models — especially when they are paying subscribers — breaks an implicit social contract.

Market Share Shifts

The controversy accelerated several trends:

MetricBefore Block (Dec 2025)After Block (Mar 2026)
OpenCode GitHub stars~56,000126,000+
OpenCode monthly active developers~2 million5 million+
OpenCode providers supported~4075+
OpenAI Codex + OpenCode usersMinimalSignificant growth

Source

Precedent for Other Tools

The OpenCode ban set a precedent that affected other third-party tools as well. Cline, RooCode, Continue, Aider, and other tools that used similar OAuth flows were also blocked. The entire ecosystem of third-party Claude-compatible tools was affected, not just OpenCode. Source


Part 7: What Developers Are Doing Now

Based on community discussions and GitHub activity, here is how the developer community has responded:

Migration Patterns

  1. Multi-provider setups: Many developers now configure OpenCode with multiple providers, using Claude via API key for tasks where it excels and cheaper alternatives for routine work
  2. OpenAI migration: A significant portion of Claude-dependent developers have moved to OpenAI's Codex, which explicitly welcomes third-party tools
  3. Local-first approaches: Interest in local models (Ollama, llama.cpp) has spiked, driven by developers who no longer want to depend on any single provider's goodwill
  4. API key adoption: Developers who want to continue using Claude have switched to API keys, accepting the higher per-token cost for the reliability of a fully supported access method

Developer Sentiment

The lasting damage may be to Anthropic's reputation within the developer community. Trust, once broken, is difficult to rebuild. Several surveys and informal polls on Hacker News and Reddit show that developer trust in Anthropic dropped significantly following the incident.


Part 8: Lessons for the AI Tooling Industry

For Tool Builders

  • Never depend on a single provider's OAuth flow as your primary authentication mechanism. Always have API key fallback.
  • Build provider-agnostic architectures from day one. OpenCode's support for 75+ providers meant the Anthropic block was painful but not fatal.
  • Expect terms to change — any feature that works "by accident" rather than by explicit agreement will eventually be shut down.

For Model Providers

  • Communicate before you block. A 30-day deprecation notice would have generated far less backlash than an overnight cutoff.
  • Offer a path forward. If you block subscription OAuth for third-party tools, simultaneously offer a third-party developer program with reasonable API pricing.
  • Remember where your training data came from. The developer community has a long memory.

For Individual Developers

  • Diversify your tool chain. Do not build your entire workflow around a single provider.
  • Understand the terms of service for every tool you depend on.
  • Keep provider dependencies behind an interface so you can focus on shipping your product rather than managing AI provider politics.

Conclusion

The OpenCode-Anthropic saga of early 2026 is more than a story about one tool being blocked. It is a case study in the tensions between open-source development culture and commercial AI business models. Anthropic had legitimate business reasons for the restriction, but the execution — silent blocks followed by legal threats — eroded trust in ways that will take years to repair.

For developers, the practical takeaway is clear: diversify your providers, use API keys when possible, and build workflows that survive policy changes. The AI tooling landscape is still young and volatile. The tools and terms you depend on today may change tomorrow.


Sources

Back to all news
Enjoyed this article?
FAQ

Common questions

Why did Anthropic block OpenCode from accessing Claude models?+
Anthropic blocked OpenCode because it was using the same OAuth authentication flow as Claude Code to access Claude Pro and Max subscriptions. Anthropic argued this violated their Terms of Service and deployed server-side fingerprinting to detect and reject requests not originating from official Claude Code clients. The company also cited revenue protection, as third-party tools were accessing subscription-tier models without Anthropic capturing the API revenue.
When did Anthropic start blocking OpenCode and what error do users see?+
Anthropic tightened server-side checks on January 8–9, 2026. Users attempting to use Claude through OpenCode began seeing the error message: 'This credential is only authorized for use with Claude Code and cannot be used for other API requests.' In February 2026 Anthropic added an 'Authentication and credential use' section to the Claude Code legal docs (an archived copy shows it live by February 18), and OpenCode removed its built-in Claude login on March 19, 2026.
What are the current workarounds for using Claude models with OpenCode?+
As of October 2026: (1) use OpenCode with an Anthropic API key, which is fully compliant; (2) use a tool that runs Anthropic's official, unmodified Claude Code with your own sign-in, such as Amp's Claude Code mode or Cline's Claude Code provider, which Anthropic's current terms allow; or (3) use a subscription OpenCode supports directly: ChatGPT Plus, GitHub Copilot or GitLab Duo. Proxies that take your Claude subscription token and call the API from another tool are still not permitted.
Did OpenAI respond to Anthropic blocking OpenCode?+
OpenCode merged ChatGPT sign-in support on January 9, 2026, the same day the block became public, and its docs now list ChatGPT Plus as a subscription you can use with zero setup. Press described this as an OpenAI partnership; we found no formal partnership announcement from OpenAI.
Can I use my Claude Pro or Max subscription in third-party tools in October 2026?+
Only through Anthropic's own software. Anthropic's current terms do not let third-party developers offer Claude.ai login or handle your Claude tokens, but they explicitly allow you to sign in to the unmodified Claude Code binary with your own subscription, even when another product hosts it. That is how Amp (since October 10, 2026) and Cline's Claude Code provider work. OpenCode itself still only supports Claude through an API key.
Is it legal to use workarounds to access Claude through OpenCode?+
Using the Anthropic API with a paid API key is fully legal and compliant. However, Anthropic's updated Terms of Service explicitly prohibit using OAuth tokens from Free, Pro, and Max plans with third-party tools. Using proxy tools or OAuth plugins to bypass this restriction technically violates Anthropic's ToS and could result in account termination.
Recommended Tools

Useful follow-ups related to this article.

Browse All Tools

Build with ZBuild

Turn your idea into a working app — no coding required.

46,000+ developers built with ZBuild this month

Build your idea with AI

Describe what you want — ZBuild builds it for you.

46,000+ developers built with ZBuild this month
More Reading

Related articles