#4246·claude-mem

[Bug] Windows: observer auth ignores the live Claude Code login (.credentials.json) and CLAUDE_MEM_CLAUDE_CONFIG_DIR

Author: mmerlino23Created Sep 27, 2026Updated Sep 27, 2026

Version: 13.25.1, Windows 11, CLAUDE_MEM_PROVIDER=claude, CLAUDE_MEM_CLAUDE_AUTH_METHOD=subscription

What happens

On Windows, eK() calls pDe(), which reads only the Windows Credential Manager generic credential Claude Code-credentials (then falls back to the CLAUDE_CODE_OAUTH_TOKEN env var). It never reads the file Claude Code actually uses on Windows, <CLAUDE_CONFIG_DIR or ~/.claude>/.credentials.json, and CLAUDE_MEM_CLAUDE_CONFIG_DIR is resolved but not passed to the win32 branch (only darwin uses it).

Result: the observer keeps using whatever account happened to be stored in Credential Manager. After the user switches Claude accounts, the observer stays on the old one, and when that account hits its 5-hour limit the observer stops saving (quota:five_hour rejected by provider) even though the account the user is logged into has quota.

Expected

On Windows, read the live login from <CLAUDE_MEM_CLAUDE_CONFIG_DIR or CLAUDE_CONFIG_DIR or ~/.claude>/.credentials.json (claudeAiOauth.accessToken / expiresAt), the same file Claude Code uses, before or instead of Credential Manager. The quota cooldown should also be keyed to the account, so switching accounts does not inherit the previous account's cooldown.

Workaround in use

A Claude Code SessionStart/UserPromptSubmit hook copies only accessToken and expiresAt from the live .credentials.json into the Claude Code-credentials entry (UTF-16LE JSON in the shape uN() parses), and clears the claude cooldown and restarts the worker when the account changes.

Related: #3718, #4149.