[Bug] OAuth refresh token not auto-refreshing on WSL — requires manual re-login daily

Resolved 💬 4 comments Opened Mar 13, 2026 by che-make Closed Apr 14, 2026

Bug Description

Bug: OAuth token not auto-refreshing on WSL — requires manual re-login daily

Description

After months of normal usage on WSL2, Claude Code started requiring me to re-authenticate every day. The OAuth access token expires but the refresh token is not being used to obtain a new access token automatically, forcing a manual login each time.

Timeline

  • Used Claude Code on WSL2 (Ubuntu) for months without any authentication issues.
  • March 12: Got logged out unexpectedly. Re-authenticated successfully.
  • March 13: Logged out again. The access token in ~/.claude/.credentials.json shows expiresAt: 2026-03-12T17:35:39Z (expired ~20h ago). A valid refreshToken is present in the file but was never used to refresh the session.

Key observation

The ~/.claude/.credentials.json file contains both an expired accessToken and a valid refreshToken, but Claude Code is not using the refresh token to renew the session — it just prompts for login again.

Environment

| Component | Version |
|---|---|
| Claude Code | 2.1.74 |
| Node.js (WSL) | v22.17.0 |
| Node.js (Windows) | v22.14.0 |
| WSL | 2.6.3.0 |
| WSL Kernel | 6.6.87.2-1 |
| Ubuntu | 24.04.2 LTS (Noble Numbat) |
| Windows | 11 Pro 10.0.26200.8037 |
| Auth method | Claude.ai OAuth |
| Subscription | Max (20x) |

Steps to reproduce

  1. Install Claude Code on WSL2 Ubuntu 24.04
  2. Authenticate via claude (OAuth login)
  3. Use normally. Wait for the access token to expire (~24h).
  4. Launch claude again — instead of refreshing the token, it prompts for a full re-login.

Expected behavior

The refresh token should be used to automatically obtain a new access token without requiring manual re-authentication.

Actual behavior

Claude Code ignores the refresh token and forces a new login when the access token expires.

Notes

  • This was not happening before — token refresh worked fine for months.
  • The issue started around March 11-12, 2026, which may coincide with a backend change or a Claude Code update.
  • Claude Code on Windows CMD (same machine, same version) does not seem to have this issue.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.74
  • Feedback ID: a19410a1-7688-45d6-96ac-739f0986b291

Errors

[{"error":"ENOENT: no such file or directory, unlink 'C:\\Users\\chema\\AppData\\Local\\Temp\\claude\\C--Users-chema\\0dcd0d02-7e1b-452f-a137-969c833ca406\\tasks\\a5c33504ea5261275.output'","timestamp":"2026-03-13T13:36:07.634Z"},{"error":"Error: ripgrep exited with code null\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:100:18094)\n    at emit (node:events:98:22)\n    at #maybeClose (node:child_process:778:16)\n    at emit (node:events:92:22)\n    at emitCloseNT (internal:streams/destroy:78:14)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-13T13:41:48.949Z"}]

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗