[Bug]: Claude provider credentials wiped (claudeAiOauth emptied, refresh token destroyed) after T3/CLI updates — recurring 'OAuth session expired and could not be refreshed' #6022
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
Setup: three Claude provider instances (one default home + two with a Claude HOME path, launched via CLAUDE_CONFIG_DIR), each logged into a different claude.ai Max account, on macOS (credentials in Keychain).
- Have all providers working.
- Update T3 Code (and/or let the bundled/system Claude CLI auto-update) and relaunch.
- Send a message on a thread using any Claude provider.
Expected behavior#
Providers stay authenticated across updates/restarts; a transient refresh failure should not destroy the stored refresh token.
Actual behavior#
Turns fail with Failed to authenticate: OAuth session expired and could not be refreshed. Inspecting the macOS Keychain entry (Claude Code-credentials[-<hash>]) shows the stored credential has been overwritten with an emptied state:
"claudeAiOauth": { "expiresAt": 0 } // accessToken and refreshToken gone
so recovery always requires a full interactive re-login — the refresh token is destroyed, not merely stale.
Observed pattern across 5 incidents in 12 days (2026-07-30, 08-02, 08-04, 08-09, 08-10 — the last one wiped all three accounts at once, right after updating to 0.0.33):
- Incidents cluster around T3 updates / Claude CLI version changes (2.1.220 → 2.1.226 over the period; three CLI versions landed in the four days covering the last three incidents).
- The keychain entry's modification timestamp updates at the moment a failing claude process runs — i.e. the process that fails the refresh writes back the emptied credential, clobbering whatever was there.
Untested hypothesis, offered in case it helps: on relaunch after an update, T3 health-checks all provider instances and spawns per-thread sessions concurrently; if two claude processes race to use a single-use rotating refresh token, the loser gets invalid_grant and persists its "failed" (empty) state over the winner's freshly rotated token. That would explain why updates/restarts are the reliable trigger and why normal day-to-day use survives refreshes fine. The underlying clobber-on-failure may be Claude CLI behavior rather than T3's, but T3's concurrent multi-instance spawning makes it trigger reliably.
Impact#
Major degradation or frequent failure — every T3 update (and some CLI auto-updates) forces an interactive re-login on up to all Claude accounts; multi-account users on phones via T3 Connect are hit hardest since re-login needs a browser flow.
Version or commit#
T3 Code (Alpha) 0.0.31 → 0.0.33; Claude CLI 2.1.220 → 2.1.226
Environment#
macOS 15 (Darwin 24.5.0), desktop app, three claudeAgent provider instances (default home + two CLAUDE_CONFIG_DIR homes), claude.ai subscription auth via Keychain
Logs or stack traces#
"error":"authentication_failed","is_api_error_message":true
"result":"Failed to authenticate: OAuth session expired and could not be refreshed","type":"result"
Workaround#
Per affected home: CLAUDE_CONFIG_DIR=<home> claude → /login → re-authenticate, then restart T3 (open threads hold stale sessions that keep reporting the old auth state even after credentials are fixed).
Related: #4696 (Claude home docs/behavior mismatch — same multi-account setup, different bug).
Thanks for the detailed report. This credential-loss bug appears to be owned by Claude Code and remains open upstream in Anthropic issue #88583.
The credential wipe is independently reproduced upstream while only Claude Desktop engines run. T3 passes the configured environment into the Claude SDK and has no claudeAiOauth or Keychain credential-write implementation. The bug remains open upstream, and Anthropic has not confirmed the proposed rotating-token race.
I'm closing this as an upstream issue as part of an automated pass on all open issues. The underlying bug is not fixed. Please continue tracking it in Anthropic issue #88583.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
I think I have the same issue but with just a single account. I have used T3 code for just a few days now. And around every other day I have to rerun /login because I got
Failed to authenticate: OAuth session expired and could not be refreshed. I didn't track it exactly but I think it mostly happened when I let T3 code update the Claude CLI.I let GPT-5.6-Terra have a look at the logs and it said: