{"record":{"id":"3cf70b356bfa91a1","repo":"stablyai/orca","slug":"claude-login-completed-but-no-oauth-credentials-w","errorCode":null,"errorMessage":"Claude login completed, but no OAuth credentials were captured.","messagePattern":"Claude login completed, but no OAuth credentials were captured\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/claude-accounts/service.ts","lineNumber":724,"sourceCode":"      }\n      return\n    }\n    rmSync(tempConfig.windowsPath, { recursive: true, force: true })\n  }\n\n  private async captureAuthFromConfigDir(\n    configDir: string,\n    statusOutput: string,\n    previousLegacyKeychain: string | null,\n    previousLegacyCredentialsSha256?: string | null\n  ): Promise<CapturedClaudeAuth> {\n    const credentialsJson = await this.readCapturedCredentials(\n      configDir,\n      previousLegacyKeychain,\n      previousLegacyCredentialsSha256\n    )\n    if (!credentialsJson) {\n      throw new Error('Claude login completed, but no OAuth credentials were captured.')\n    }\n    const oauthAccount = this.readOauthAccountFromConfigDir(configDir)\n    const identity = this.resolveIdentity(statusOutput, oauthAccount, credentialsJson)\n    return { credentialsJson, oauthAccount, identity }\n  }\n\n  private async readCapturedCredentials(\n    configDir: string,\n    previousLegacyKeychain: string | null,\n    previousLegacyCredentialsSha256?: string | null\n  ): Promise<string | null> {\n    if (process.platform === 'darwin') {\n      const scopedCredentialsJson = await readActiveClaudeKeychainCredentialsStrict(configDir)\n      if (scopedCredentialsJson) {\n        return scopedCredentialsJson\n      }\n      const legacyCredentialsJson = await readActiveClaudeKeychainCredentialsStrict()\n      const legacyChanged =","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/claude-accounts/service.ts#L706-L742","documentation":"Thrown by captureAuthFromConfigDir() when readCapturedCredentials() returns null/empty after a login. On macOS this means neither the scoped nor the legacy Keychain item yielded credentials (and the legacy value did not change from baseline). On Linux/Windows the .credentials.json was absent or empty. The login reportedly completed but no OAuth credential material was found to persist.","triggerScenarios":"On macOS: the Claude CLI did not write to the scoped or legacy Keychain item, or wrote an identical value. On Linux/Windows: .credentials.json is missing or empty after login. The CLI wrote credentials elsewhere (wrong CLAUDE_CONFIG_DIR). A login that exited 0 but never authenticated (e.g. user closed the browser).","commonSituations":"CLAUDE_CONFIG_DIR mismatch between spawn and read. Keychain access denied on macOS so the CLI silently failed to store. Older CLI version ignoring CLAUDE_CONFIG_DIR and writing to the default location. The login was interrupted after the browser step but before credential persistence.","solutions":["Ensure CLAUDE_CONFIG_DIR passed to `claude auth login` matches the dir read by readCapturedCredentials.","On macOS, grant Keychain access to the CLI/Orca and confirm the login Keychain is unlocked.","Update the Claude CLI so it honors CLAUDE_CONFIG_DIR for Keychain scoping.","Retry the login; if persistent, inspect where the CLI actually wrote credentials."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await captureAuthFromConfigDir(...)\n} catch (error) {\n  if (error instanceof Error && /no OAuth credentials were captured/.test(error.message)) {\n    // verify CLAUDE_CONFIG_DIR alignment and Keychain access, then retry\n  }\n  throw error\n}","preventionTips":["Keep CLAUDE_CONFIG_DIR identical between login spawn and credential read.","On macOS, unlock the Keychain and grant CLI access before login.","Update the Claude CLI to honor CLAUDE_CONFIG_DIR for Keychain scoping.","Confirm the login fully completed (browser step + credential write) before capture."],"tags":["claude-accounts","credentials","oauth","login","keychain"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}