---
title: "Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh (fix)"
canonical_url: "https://superbot.gg/fix/failed-to-refresh-oauth-token"
summary: "Claude Code could not refresh your login because another process holds the refresh lock. It does not mean your login was rejected. How to clear it."
---

> Markdown of https://superbot.gg/fix/failed-to-refresh-oauth-token. Site index: /llms.txt.

Claude Code error

# Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh

This is the start of a longer message that `claude -p` and the Agent SDK print. An interactive session words it differently.

Your login needed renewing and another process was in the way.
It does not mean the login was rejected.

[Get the app](https://superbot.gg/download?cta%5Fid=page%5Finstall) [other errors](https://superbot.gg/fix)

## What it means

Your saved claude.ai login had expired and needed renewing. Another Claude Code process on the same machine held the shared refresh lock, or exited and left it behind.

Claude Code stops the request before sending it. In an interactive session the message reads: `Could not refresh your login because another Claude Code process is refreshing it (or exited mid-refresh) · Try again in a minute; if it keeps happening, close other Claude Code windows or sign in again with /login`

## Fix it

1. Try again in a minute. If the other process finishes the refresh first, your session uses the renewed login.
2. If it keeps coming back, close other Claude Code windows and processes, then retry.
3. If it returns with no other Claude Code process running, run `/login`. Signing in again does not wait on the lock.

## Switch while you wait

A session that uses an API key, `CLAUDE_CODE_OAUTH_TOKEN`, or a cloud provider does not use the saved login and never sees this message.

If several headless jobs share one login, give them your own Anthropic API key instead.

## With superbot

superbot is your own AI agent with a model of its own that runs on superbot credits, so it keeps working when a vendor's plan runs out.

It also puts your own API keys behind one base URL, with one caller key, in the OpenAI or Anthropic format.

Calls on your own keys spend no superbot credits, and you pay your provider as usual.

Claude Code takes an Anthropic base URL, so see [the ANTHROPIC_BASE_URL page](https://superbot.gg/docs/anthropic-base-url).

## Related

- [MCP server "<name>" needs you to sign in again (run /mcp to…](https://superbot.gg/fix/mcp-server-needs-you-to-sign-in-again)
- [You've hit your session limit · resets 3:45pm](https://superbot.gg/fix/session-limit)
- [API Error: Server is temporarily limiting requests (not your usage…](https://superbot.gg/fix/server-temporarily-limiting-requests)

Source: [Claude Code docs: errors, failed to refresh OAuth token](https://code.claude.com/docs/en/errors). Read on 2026-10-17.
