Claude Code OAuth token expired. Here's the fix.

Anthropic is removing Claude OAuth support from third-party apps like OpenClaw, confirmed by a GitHub commit from the OpenCode team. There's a quick config fix that restored access temporarily — but the change is coming. Here's what happened, what your options are, and whether Google AI Ultra...

Claude Code OAuth token expired. Here's the fix.

Get a free week of ClaudeTry Claude free for a week

SPONSORED
CTA Image

Omnisend is email marketing built for e-commerce. It integrates directly with Shopify, WooCommerce, and BigCommerce, with features like a product picker in the editor and abandoned cart automation that runs on autopilot. Free plan includes all features.

Try Omnisend Free

What Started All This

In my previous video I covered how my OpenClaw OAuth access got cut off after I updated to Claude Sonnet 4.6. My initial read was that it was tied to Anthropic's broader crackdown on using OAuth with third-party applications — and that situation is real. But a viewer spotted something I missed: there was also a much simpler explanation hiding in plain sight.

To be clear about where I stand on this: Anthropic is completely within their rights to limit how their product can be used. Same way Apple can cap iCloud free storage at 5GB even though your phone holds 10 times that — it's their product, their call. My original video was a consumer reaction, not a legal challenge. I wanted something different. That's allowed too.

But the situation has two parts — a config issue AND a real enforcement action — and they were happening at the same time, which made everything confusing. Here's how to separate them.

The Configuration Fix That Restored OAuth

A viewer left a comment pointing out that OAuth failures in OpenClaw may not have been a ban at all. The issue: if you had selected a model with a 1 million token context window, OAuth doesn't work with that version. Switch to Claude Sonnet 4.6 or Opus 4.6 at the 200k context window and the stored credentials work immediately — no re-authentication needed.

Screenshot: The Context Window Fix That Restored OAuth
The Context Window Fix That Restored OAuth

I tested this with my OpenClaw agent Lloyd and it worked. Switched to Sonnet, started a new session, and we were back on Claude Sonnet 4.6 with the OAuth credential that was previously stored. No block, no error.

I also tested it on OpenCode. One thing worth knowing: when you get an OAuth code from a terminal, it can wrap to the next line and leave a gap in what you copy. If you paste it and authentication fails, check for invisible line breaks. Running the code through Claude Desktop to clean up extra spaces fixed it for me. The auth flow went through fine and the model responded normally.

You're Still Breaking the Terms of Service

Here's where it gets uncomfortable. Even with the config fix working, using OAuth with OpenClaw against Anthropic's terms of service is still a violation. As I read the TOS, this type of third-party OAuth access isn't officially supported or permitted.

The reason OAuth matters so much for autonomous agents is spending control. When an agent is running tasks while you sleep, you need a hard cap on what it can spend. OAuth lets you use your flat-rate subscription — Claude Max or Pro — as that ceiling. Without it, the Anthropic API has no hard spending limit. Per-token billing with no cap is a real risk when you're running automations you can't monitor in real time.

That's why I was so interested in making this work — not to get something for free, but to have predictable costs on an autonomous system. But whether it's technically working or not, I'm operating outside the terms I agreed to.

This isn't based on rumors or screenshots. A tweet from Jane Manchin Wong surfaced a GitHub commit from OpenCode — made by Dax, one of the project leads — with a commit message that reads: "Anthropic's legal request removes Claude OAuth support and redirects users to alternatives like OpenAI, GitHub, and GitLab."

Screenshot: Anthropic's GitHub Commit Confirms Legal Action
Anthropic's GitHub Commit Confirms Legal Action

That's a direct legal request from Anthropic, and OpenCode is complying. Users will be redirected to alternatives that allow OAuth — OpenAI, GitHub, GitLab — if they want to use third-party tools with an OAuth auth flow. The commit is heading to the main branch soon. It may already be live by the time you read this.

So the current situation is: OAuth may still technically work depending on your setup and timing. But the infrastructure is being dismantled. Planning your workflow around OAuth with Claude staying available is not a smart move.

Your Real Options Going Forward

Option one: switch to the Anthropic API. You lose the flat-rate subscription as a spending cap, but you get everything — the full 1M context window, full model access, and you're operating within the terms. Pay-per-token costs more at scale, but you're doing the right thing and getting the full feature set. Worth it if you're doing serious work with Claude.

Screenshot: Your Options: API, OpenAI, or Something Else
Your Options: API, OpenAI, or Something Else

Option two: switch your OpenClaw backend to OpenAI. Peter Steinberger, the founder of OpenClaw, was recently hired by OpenAI, and OpenAI has confirmed they're allowing OAuth authentication with OpenClaw. So you could maintain the subscription-cap model by moving to an OpenAI plan. Personally, OpenAI just doesn't sit right with me — I've used ChatGPT for years and still pay for it, but I don't think I want it powering my personal agent.

Option three: wait and evaluate. My Claude Max subscription is still active for another week or so. I'm not making any permanent moves until I have a clearer picture of what my actual agent usage looks like and which path makes the most sense long term.

Claude Security: Anthropic's New Vulnerability Scanner

Right before I hit record, Anthropic announced Claude Security — a tool designed to scan vibe-coded software for security vulnerabilities. If you've been building apps with AI-generated code and shipping them without a proper security review, this is exactly the kind of thing you need.

Screenshot: Claude Security: New Vulnerability Scanner
Claude Security: New Vulnerability Scanner

One of the biggest problems with vibe-coded apps is that they can expose API keys, display client data publicly, or have security gaps that neither you nor the AI caught during development. Claude Security is built to catch those issues automatically.

The catch: it's not publicly available yet. There's a waitlist, and from what I've heard they're prioritizing enterprise customers first. You need an active paid subscription to apply. I filled out the form, but I'm not expecting early access. Worth signing up if you're shipping AI-generated code — it's the kind of tool that'll save someone from a very bad day.

Google Gemini AI Ultra: A Serious Claude Alternative

With my Claude Max situation up in the air, I've been looking harder at alternatives. Google just released Gemini Pro 3.1, and the benchmarks are legitimately impressive — reportedly better than Claude Opus at roughly half the API price. That's not a small gap.

Screenshot: Google Gemini AI Ultra as a Claude Alternative
Google Gemini AI Ultra as a Claude Alternative

To be clear: you can't use OAuth with Google's AI plans either. They'd ban you faster than Anthropic does. So this doesn't solve the agent spending-cap problem. But as a daily driver subscription — something on my phone and desktop for general AI use — Google AI Ultra is worth a real look.

The subscription bundles a lot. You get YouTube Premium (worth around $15-17/month standalone), 30 terabytes of Google Workspace storage, and watermark-free image generation in NotebookLM and Imagen. That last one matters more than people realize — AI-generated images with no watermark means you can actually use them in videos, presentations, or client work. If you haven't tried NotebookLM for generating slides yet, it's worth a test.

How to Get an Extra 15% Off Google AI Ultra via Workspace

The main Google AI Ultra page advertises 50% off for the first three months — bringing a $250/month plan down to $125. If you're a Google Workspace subscriber, there's a better deal buried in your admin panel.

Screenshot: Getting Extra Off via Google Workspace
Getting Extra Off via Google Workspace

Log into your Workspace admin account, go to Billing → Buy or Upgrade → Advanced AI Access. Workspace pricing applies an additional 15% discount on top of the promotional rate. Instead of $125, you're paying $106 for the first three months.

Better still, that 15% discount appears to persist as long as you maintain your Workspace account — bringing the regular rate down to around $212/month instead of $250. That puts it in the same ballpark as Claude Max. I'm not paying annually for anything AI-related — by the time I click checkout, a new model will have come out — so monthly with the Workspace discount is the path I'd take if I go this direction.

The AI Family Plan Nobody Has Built Yet

One thing that's been on my mind as this whole situation has unfolded: I'd love to see one of the major AI providers launch a family plan. The same way Spotify or Apple One lets you pay once and extend access to everyone in your household — a Google Gemini family pack or a ChatGPT family pack with roles and permissions would be genuinely useful.

Screenshot: The AI Family Plan We All Need
The AI Family Plan We All Need

Parent accounts with full access, kid accounts that are more locked down and observable by parents. A dashboard where parents can see what their kids are using AI for. That kind of transparency would help a lot of families feel comfortable letting younger users work with these tools — and it's a real market that doesn't exist yet.

I have to think someone is already building this internally. Whoever ships it first will have a real edge. If you see anything moving in this space, let me know.

OAuth Token Expiry & Renewal

One of the most common issues with Claude Code OAuth is unexpected token expiry. Anthropic OAuth access tokens are short-lived — typically expiring within 60 minutes. When a token expires mid-session, your agent loses authentication and any running task fails silently or throws a generic 401 error.

The refresh flow works like this: your initial OAuth authentication generates both an access token and a refresh token. The access token handles API requests but expires quickly. The refresh token is longer-lived and can request a new access token without re-authenticating. However, if Anthropic has revoked your refresh token — which is increasingly common for third-party app usage — the entire chain breaks.

If you're running Claude Code overnight or during long autonomous sessions, token expiry is almost guaranteed to interrupt your workflow. The Anthropic API with a persistent API key is the only reliable solution for unattended operation, since API keys don't expire unless you manually rotate them.

Troubleshooting Claude OAuth

If Claude OAuth isn't working, start with these common fixes:

First, check your model selection. As covered earlier, selecting a model with a 1M token context window breaks OAuth in OpenClaw and similar tools. Switch to the 200k context variant and retry.

Second, verify your OAuth token hasn't expired. Open your tool's config or token storage and check the token timestamp. If it's older than an hour, you need to re-authenticate.

Third, check whether Anthropic has revoked third-party access for your account. The clearest sign is that re-authentication itself fails — you can authenticate in claude.ai but the OAuth flow for external apps returns an error. If this is happening, Anthropic has likely flagged your usage.

Fourth, if you're using OpenClaw specifically, make sure your config points to the correct OAuth endpoint. Configuration mismatches after updates are a frequent cause of authentication failures. For a deeper look at configuring OpenClaw and connecting it with tools like Obsidian for better agent memory, see our OpenClaw integration guide.

Where Things Stand

The short version: a configuration fix (switching from the 1M to 200k context window model) restored Claude OAuth temporarily in OpenClaw and OpenCode. But Anthropic's legal action, confirmed by a real GitHub commit, means OAuth support in third-party apps is going away. If you're currently relying on OAuth for spending control with an autonomous agent, now is the time to figure out your next move.

My personal plan is still forming. The Anthropic API gives me everything I want technically, but loses the spending cap that makes autonomous agents safer to run. OpenAI via OpenClaw would work, but I'm not enthusiastic about it. Google AI Ultra is genuinely compelling as a daily driver, especially with the Workspace discount — but it doesn't solve the OAuth agent problem either.

Whatever direction you go, the era of using Claude Max via OAuth with third-party tools is ending. Better to plan for it on your own timeline than get caught off guard when the commit hits main.


Frequently Asked Questions

Why did Claude OAuth stop working in OpenClaw?

There were two overlapping reasons. First, selecting a model with a 1M token context window breaks OAuth — switching to Sonnet 4.6 or Opus 4.6 at 200k tokens fixes it immediately. Second, Anthropic sent a legal request to OpenCode confirming that OAuth support is being removed from third-party Claude integrations entirely.

Is using Claude Max with OAuth against Anthropic's terms of service?

Based on a reading of the TOS, yes. Using OAuth to connect Claude Max or Claude Pro to third-party applications like OpenClaw appears to be a violation. Anthropic is actively taking legal steps to enforce this, as confirmed by the OpenCode GitHub commit.

What is OAuth and why does it matter for AI agents?

OAuth lets you authenticate a third-party app using your existing subscription rather than a separate API key. For autonomous agents, this is important because it caps spending at your flat monthly subscription rate. Without OAuth, agents run on per-token API billing with no hard spending ceiling.

What are my options if Claude OAuth goes away?

You have three main paths: switch to the Anthropic API for per-token billing with full features and compliance, move to OpenAI via OpenClaw which currently allows OAuth, or use a different AI subscription as your daily driver while you evaluate longer-term options.

What is Claude Security?

Claude Security is a new Anthropic feature that scans vibe-coded software for vulnerabilities like exposed API keys and publicly visible client data. It's currently waitlist-only and prioritizes enterprise customers, but anyone with an active paid subscription can apply.

Is Google Gemini AI Ultra worth it as a Claude alternative?

For general daily AI use, it's genuinely competitive. Gemini Pro 3.1 benchmarks well, and the subscription bundles YouTube Premium, 30TB of Workspace storage, and watermark-free image generation. However, it doesn't solve the OAuth spending-cap problem for autonomous agents — Google doesn't allow OAuth with their AI plans either.

How do I get the extra 15% discount on Google AI Ultra?

If you're a Google Workspace subscriber, log into your Workspace admin account, go to Billing → Buy or Upgrade → Advanced AI Access. You'll see pricing with an additional 15% off compared to the main consumer site, and that discount appears to persist as long as you maintain your Workspace account.

Will any AI provider offer a family plan soon?

None of the major providers — Google, Anthropic, or OpenAI — currently offer a family plan with parent and child accounts. It's an obvious gap, and someone will likely fill it, but there's no announced timeline from any of the major players as of now.

Do Claude OAuth tokens expire?

Yes. Claude OAuth access tokens are short-lived and expire after a set period — typically within an hour. When the token expires, the client needs to use a refresh token to get a new access token. If the refresh token itself has been revoked or has expired, you'll need to re-authenticate entirely. This is a common issue for autonomous agents running Claude Code overnight: the agent authenticates, starts a task, and the session dies mid-run when the token expires. The practical fix is switching to the Anthropic API with a persistent API key, which doesn't expire unless you manually rotate it.

Get a free week of ClaudeTry Claude free for a week

Get Dave's Toolbox

The tools I actually use, every Tuesday. Free. No spam.

Thanks for subscribing! Emails land every Tuesday and Friday.

No cost. No spam. Unsubscribe anytime.

Share this post

Search