<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: anthopen</title>
    <description>The latest articles on DEV Community by anthopen (@rogoltmalki766).</description>
    <link>https://dev.to/rogoltmalki766</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3835905%2Ff6fc7d26-d459-437a-a5b7-c35b0eccc304.png</url>
      <title>DEV Community: anthopen</title>
      <link>https://dev.to/rogoltmalki766</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rogoltmalki766"/>
    <language>en</language>
    <item>
      <title>OpenCode + Claude Broken? Fix "invalid token" and Restore Anthropic Access</title>
      <dc:creator>anthopen</dc:creator>
      <pubDate>Fri, 20 Mar 2026 18:00:24 +0000</pubDate>
      <link>https://dev.to/rogoltmalki766/opencode-claude-broken-fix-invalid-token-and-restore-anthropic-access-297k</link>
      <guid>https://dev.to/rogoltmalki766/opencode-claude-broken-fix-invalid-token-and-restore-anthropic-access-297k</guid>
      <description>&lt;p&gt;OpenCode + Claude Broken? Fix "invalid token" and Restore Anthropic Access&lt;/p&gt;

&lt;p&gt;If you're using OpenCode with Claude, you probably hit this recently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;invalid token&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;authentication failed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Claude just stopped responding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No warning. No clear explanation. Just broken workflows.&lt;/p&gt;

&lt;p&gt;Let’s fix that.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 The Fix (Working Right Now)
&lt;/h2&gt;

&lt;p&gt;There’s a simple workaround that restores Claude access using OAuth:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/rogoltmalki766/opencode-anthropic-oauth" rel="noopener noreferrer"&gt;https://github.com/rogoltmalki766/opencode-anthropic-oauth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This plugin allows you to log in with your Claude Pro / Max account directly inside OpenCode — no Claude Code, no manual tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you get
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Claude working again in OpenCode&lt;/li&gt;
&lt;li&gt;Full access to Anthropic models&lt;/li&gt;
&lt;li&gt;No more &lt;code&gt;invalid token&lt;/code&gt; errors&lt;/li&gt;
&lt;li&gt;Automatic authentication + refresh&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ Setup (Takes 1 Minute)
&lt;/h2&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```bash id="c7z8p1"&lt;br&gt;
npm install -g opencode-anthropic-oauth&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Add plugin:



```json id="cbq6lq"
{
  "plugin": ["opencode-anthropic-oauth"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```bash id="0kchxy"&lt;br&gt;
/connect&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


or:



```bash id="zv6h0s"
oc auth login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select &lt;code&gt;Anthropic → Claude Pro/Max&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open browser login&lt;/li&gt;
&lt;li&gt;Paste the code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;✅ Done. Claude is back.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why This Works
&lt;/h2&gt;

&lt;p&gt;Instead of relying on outdated token methods, this uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OAuth PKCE flow&lt;/li&gt;
&lt;li&gt;Official Anthropic auth endpoints&lt;/li&gt;
&lt;li&gt;Browser-based login (secure)&lt;/li&gt;
&lt;li&gt;Access + refresh token lifecycle&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 In short: it mimics a real login instead of relying on static tokens.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔁 Alternative (Official Way)
&lt;/h2&gt;

&lt;p&gt;If you want something fully compliant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Anthropic API keys&lt;/li&gt;
&lt;li&gt;Pay per usage&lt;/li&gt;
&lt;li&gt;Works everywhere&lt;/li&gt;
&lt;li&gt;No dependency on subscriptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;p&gt;💸 It’s more expensive&lt;br&gt;
⚙️ Requires manual setup&lt;/p&gt;




&lt;h2&gt;
  
  
  💥 What Broke OpenCode?
&lt;/h2&gt;

&lt;p&gt;Anthropic recently tightened how authentication works.&lt;/p&gt;

&lt;p&gt;That led to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subscription tokens no longer working externally&lt;/li&gt;
&lt;li&gt;OpenCode integrations breaking&lt;/li&gt;
&lt;li&gt;Widespread &lt;code&gt;invalid token&lt;/code&gt; errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can’t use Claude Pro/Max tokens outside official clients anymore.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚠️ Disclaimer
&lt;/h2&gt;

&lt;p&gt;This solution uses Anthropic’s public OAuth client.&lt;/p&gt;

&lt;p&gt;According to their ToS (Feb 2026):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subscription tokens are intended for official use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 This is a workaround&lt;br&gt;
👉 It may break in the future&lt;/p&gt;

&lt;p&gt;Use it carefully.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧾 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;AI tools are moving toward closed ecosystems.&lt;/p&gt;

&lt;p&gt;But developers will always find ways to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stay flexible&lt;/li&gt;
&lt;li&gt;avoid lock-in&lt;/li&gt;
&lt;li&gt;keep building&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your workflow broke — now you know how to fix it.&lt;/p&gt;




&lt;p&gt;⭐ If this helped you:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/rogoltmalki766/opencode-anthropic-oauth" rel="noopener noreferrer"&gt;https://github.com/rogoltmalki766/opencode-anthropic-oauth&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
