Skip to content

Commit e75cc1a

Browse files
fix: read Claude live usage from ~/.claude/.credentials.json, not stale keychain
Root cause of the missing Claude 5h/7d usage windows: newer Claude Code stores the active account's OAuth in ~/.claude/.credentials.json (a file it refreshes in place), while CodeVetter only read the macOS keychain. The keychain "Claude Code-credentials" entries are stale leftovers from an older Claude Code version — expired for hours and never refreshed by `/login` — so every live-usage call got a 401 and fell back to local estimates. read_full_credential now prefers the credentials file for the primary account and falls back to the keychain. Verified live (sole-instance dev build): the Claude Max card renders 5h ~0% / 7d ~22%, matching the API's unified-ratelimit headers exactly. Also adds a self-healing token refresh: if the stored access token is expired (e.g. Claude Code idle >8h), CodeVetter refreshes it via the stored refresh token against console.anthropic.com/v1/oauth/token and writes the rotated pair back to wherever it came from (atomic file replace, or keychain -U) — mirroring what Claude Code itself does, so the two stay in sync. Refresh failures (incl. 429) surface gracefully as the existing live-error hint; no write happens unless the refresh succeeds. Bumps desktop app to 1.1.70. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent be04109 commit e75cc1a

3 files changed

Lines changed: 335 additions & 68 deletions

File tree

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code-reviewer/desktop",
3-
"version": "1.1.69",
3+
"version": "1.1.70",
44
"private": true,
55
"scripts": {
66
"dev": "lsof -ti:1420 | xargs kill -9 2>/dev/null; vite",

0 commit comments

Comments
 (0)