Claude Code “OAuth session expired and could not be refreshed”
Claude Code says its OAuth session expired and could not be refreshed? Check which process failed, sign in through Claude, and inspect unfinished agent work.
Quick answer
This message means the affected Claude Code process could not refresh its sign-in session. It does not necessarily mean the whole Claude service is down: a background agent can stop while the main session keeps working. Before restarting or signing in again, check what the agent already changed.
What to do
- Note whether the failure came from the main CLI, VS Code, Desktop, or a background agent. Save the exact message, time, and version.
- Inspect files, tests, and tool results already produced by the affected process. Do not launch the same write task twice without checking its output.
- If the main CLI also cannot authenticate, run
claude auth statusto check its signed-in state, thenclaude auth loginthrough Claude's own flow if needed. Both commands are in the official CLI reference. Do not paste credentials into a third-party form. Desktop and extension sign-in controls may differ. - If only one background agent failed, try resuming that agent from the working main session where supported. Verify it picked up the intended task and files.
What users reported
In a November 1 GitHub issue, a user said background subagents stopped with this message after about 20 minutes while the main session still worked. The reporter resumed each affected agent with SendMessage and retained context in that case. An older CLI report says manually running /login restored that user's authentication. These are different client situations; neither proves why your refresh failed or guarantees the same recovery.
Frequently Asked Questions
Should I restart the whole project?
Check the main session and saved work first. A failed background agent may be resumable without discarding the project or running completed steps again.
Does a working main session rule out an auth problem?
No. The November report shows the processes can behave differently. Identify exactly which one returned the message.
Is this proof Claude is down?
No. Compare the affected Claude Code surface with official status, then use the exact authentication message for support.
Sources
- Official: Claude Code CLI authentication commands; setup and sign-in options.
- User reports: background-agent OAuth failure; CLI re-login case.