Skip to content

Claude sign-in: one click to sign in again when it ran out - #217

Merged
danielehrhardt merged 1 commit into
mainfrom
feat/claude-relogin
Oct 20, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
feat/claude-relogin

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

What

When Claude Code's sign-in runs out ("Failed to authenticate: OAuth session expired and could not be refreshed"), Godmode now says so everywhere and fixes it with one click:

  • Banner above every page: "Claude is signed out. Your agents can't work until you sign in again." with Sign in again. The steps (finish in the browser, or open the page and paste the code) show right in the banner, and it goes away once Claude works again.
  • In the chat: the failed turn offers Sign in again instead of a retry that fails the same way. Once the sign-in is done, the chat continues by itself.
  • From the phone: on Godmode Cloud or remote access the steps switch to "open the Claude sign-in page, authorize, paste the code" so the owner can sign the computer in from anywhere. Only the computer's owner may do this through the cloud (operators and viewers can't).
  • Notification: one "Claude is signed out" notification per episode, so unattended automations failing at night are noticed.
  • Settings → System: the Claude login row now turns red with the sign-in button (before it stayed green, because claude auth status still says "logged in" when the stored sign-in ran out).

How

  • services/claudeLogin.ts keeps a "signed out" mark (stored in meta, survives restarts). A run that fails with the sign-in error sets it; a run that gets an answer from Claude, a finished sign-in, or new credentials written by Claude Code (keychain item / .credentials.json changed, e.g. a sign-in in a terminal) clear it. Changes go out as a claude.login event.
  • The doctor's Claude login check honors the mark; an Anthropic API key that was refused points to Integrations → API keys instead.
  • Cloud scope: POST|DELETE /api/doctor/claude-login and POST /api/doctor/claude-login/code are owner-only instead of refused.
  • UI: shared useClaudeLogin hook and ClaudeSignInSteps panel used by the banner, the chat turn end and the Settings checklist.

Screenshots

Taken in a sandbox with a fake signed-out Claude: signed out (banner + chat), signing in with the paste-code fallback, signed in and the chat continued by itself, and the phone view (open page + paste code).

Tests

  • claude-login.test.ts: mark set once, cleared by a working run, by a sign-in and by new credentials; stored in meta.
  • runner.test.ts: an expired sign-in sets the mark and notifies once; the next answer clears it.
  • cloud-scope.test.ts: only the owner may start or finish the sign-in from the cloud.

When Claude Code's sign-in runs out, `claude auth status` still says
"logged in", so Settings stayed green and the chat only offered a retry
that failed the same way. A run that ends over the sign-in now marks
Claude as signed out (kept across restarts) until a run gets an answer,
a sign-in finishes, or Claude Code writes new credentials.

- A banner above every page says Claude is signed out, with Sign in
  again and the steps right there; it goes once Claude works again.
- The failed chat turn signs in inline and continues by itself.
- From a phone (Godmode Cloud, remote access) the steps are open the
  sign-in page and paste the code; only the computer's owner may do it
  through the cloud.
- One notification per episode; the doctor's Claude login row turns red.
- A refused Anthropic API key points to Integrations instead.
@danielehrhardt
danielehrhardt merged commit 56a624b into main Oct 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant