claude-code - 💡(How to fix) Fix [BUG] claudeCode.disableLoginPrompt: true silently stops working after async CLI auth check resolves with loggedIn: false [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56183Fetched 2026-05-06 06:34:59
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×6commented ×1

Error Message

Error Messages/Logs

Root Cause

The claudeCode.disableLoginPrompt: true VS Code setting is supposed to suppress the Anthropic login screen for users on third-party auth (Bedrock, Vertex, custom apiKeyHelper setups). It works on the first state load, but the login screen appears anyway shortly after VS Code opens, because the setting’s effect is bypassed by a race condition in the async CLI auth check.

Fix Action

Workaround

Keep the underlying auth token perpetually fresh so claude auth status never returns loggedIn: false. On macOS this can be done with a LaunchAgent:

# ~/Library/LaunchAgents/com.example.claude-token-refresh.plist
# StartInterval: 14400 (4 hours)
# ProgramArguments: databricks auth token --profile <profile> --force-refresh

This prevents the symptom but does not fix the underlying bug in the extension.

Code Example

// Before (broken):
return this.cachedCliAuthStatus;

// After (respects disableLoginPrompt):
return this.cachedCliAuthStatus ?? this.authManager.getAuthStatus();
This is the same pattern already used correctly in the !cachedCliAuthStatusFetched branch.

---



---

getAuthStatus() {
  if (this.disableAuthLogin)   // set from claudeCode.disableLoginPrompt
    return { authMethod: "not-specified", email: null, subscriptionType: null };
  // ...
}

---

getAuthStatus() {
  if (!this.cachedCliAuthStatusFetched) {
    // First call: fires async CLI check, returns authManager.getAuthStatus() immediately.
    // → disableAuthLogin is respected here, login screen hidden ✓
    return this.refreshCliAuthStatus().then(...), this.authManager.getAuthStatus();
  }
  // Subsequent calls: returns cachedCliAuthStatus DIRECTLY, no fallback to authManager.
  return this.cachedCliAuthStatus;  // ← can be undefined!
}

---

function aE4(result) {
  if (!result.loggedIn) return;  // returns undefined when loggedIn: false
  // ...
}

---

// In webview requestInit handler:
if ($.state.authStatus !== void 0)
  this.authStatus.value = $.state.authStatus;
else if (this.authStatus.value === void 0)
  this.authStatus.value = null;  // ← triggers login screen

// isAuthenticated computed:
isAuthenticated = () => {
  if (this.authStatus.value !== null) return true;  // null → false → login screen shown
  // ...
};

---

# ~/Library/LaunchAgents/com.example.claude-token-refresh.plist
# StartInterval: 14400 (4 hours)
# ProgramArguments: databricks auth token --profile <profile> --force-refresh
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The claudeCode.disableLoginPrompt: true VS Code setting is supposed to suppress the Anthropic login screen for users on third-party auth (Bedrock, Vertex, custom apiKeyHelper setups). It works on the first state load, but the login screen appears anyway shortly after VS Code opens, because the setting’s effect is bypassed by a race condition in the async CLI auth check.

What Should Happen?

According to Claude's own analysis:

When claudeCode.disableLoginPrompt: true is set, the login screen should never appear regardless of what claude auth status returns. The disableLoginPrompt guard should apply as a fallback at every point where authStatus would otherwise be returned as null/undefined.

A minimal fix in the channel manager would be:

// Before (broken):
return this.cachedCliAuthStatus;

// After (respects disableLoginPrompt):
return this.cachedCliAuthStatus ?? this.authManager.getAuthStatus();
This is the same pattern already used correctly in the !cachedCliAuthStatusFetched branch.

Error Messages/Logs

Steps to Reproduce

  1. Configure Claude Code with an apiKeyHelper in ~/.claude/settings.json (e.g. a Databricks/Bedrock token helper).
  2. Set "claudeCode.disableLoginPrompt": true in VS Code User settings.
  3. Allow the OAuth access token managed by the helper to expire (or simulate by temporarily breaking the helper).
  4. Open VS Code.

Expected: Login screen does not appear; the extension uses apiKeyHelper for actual API calls as normal. **

<img width="474" height="642" alt="Image" src="https://github.com/user-attachments/assets/11e049d3-a879-42c4-bd62-b069e4804e16" />

**: The login screen (with options for Claude.ai Subscription, Anthropic Console, Bedrock/Foundry/Vertex, “Run Claude in terminal”) appears a moment after the sidebar loads.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.128

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

According to Claude:

Root Cause (traced from extension.js)

The VS Code extension has two separate auth-status code paths:

  1. q2.getAuthStatus() (AuthManager) — respects the setting correctly:
getAuthStatus() {
  if (this.disableAuthLogin)   // set from claudeCode.disableLoginPrompt
    return { authMethod: "not-specified", email: null, subscriptionType: null };
  // ...
}
  1. Channel manager getAuthStatus() — bypasses q2 after the first async check:
getAuthStatus() {
  if (!this.cachedCliAuthStatusFetched) {
    // First call: fires async CLI check, returns authManager.getAuthStatus() immediately.
    // → disableAuthLogin is respected here, login screen hidden ✓
    return this.refreshCliAuthStatus().then(...), this.authManager.getAuthStatus();
  }
  // Subsequent calls: returns cachedCliAuthStatus DIRECTLY, no fallback to authManager.
  return this.cachedCliAuthStatus;  // ← can be undefined!
}
  1. refreshCliAuthStatus() runs claude auth status --json as a subprocess. The result is processed by aE4():
function aE4(result) {
  if (!result.loggedIn) return;  // returns undefined when loggedIn: false
  // ...
}

When the CLI auth check returns loggedIn: false (e.g. token expired, helper temporarily unavailable), cachedCliAuthStatus is set to undefined. The channel manager then returns undefined from getAuthStatus(), bypassing q2 entirely.

  1. The webview receives authStatus: undefined and shows the login screen:
// In webview requestInit handler:
if ($.state.authStatus !== void 0)
  this.authStatus.value = $.state.authStatus;
else if (this.authStatus.value === void 0)
  this.authStatus.value = null;  // ← triggers login screen

// isAuthenticated computed:
isAuthenticated = () => {
  if (this.authStatus.value !== null) return true;  // null → false → login screen shown
  // ...
};

The setting disableLoginPrompt is never consulted again after cachedCliAuthStatusFetched becomes true.


Environment

FieldValue
VS Code extension version2.1.126
OSmacOS 13.6 (darwin arm64)
Auth methodapiKeyHelper (Databricks serving endpoint)
claudeCode.disableLoginPrompttrue (confirmed in User settings)

Workaround

Keep the underlying auth token perpetually fresh so claude auth status never returns loggedIn: false. On macOS this can be done with a LaunchAgent:

# ~/Library/LaunchAgents/com.example.claude-token-refresh.plist
# StartInterval: 14400 (4 hours)
# ProgramArguments: databricks auth token --profile <profile> --force-refresh

This prevents the symptom but does not fix the underlying bug in the extension.

extent analysis

TL;DR

The most likely fix is to update the channel manager's getAuthStatus() method to respect the claudeCode.disableLoginPrompt setting by using the nullish coalescing operator (??) to fall back to authManager.getAuthStatus() when cachedCliAuthStatus is undefined.

Guidance

  • The issue is caused by a race condition in the async CLI auth check, which bypasses the claudeCode.disableLoginPrompt setting after the first state load.
  • To fix this, update the getAuthStatus() method in the channel manager to use the nullish coalescing operator (??) to fall back to authManager.getAuthStatus() when cachedCliAuthStatus is undefined.
  • Verify that the fix works by setting claudeCode.disableLoginPrompt to true and checking that the login screen does not appear even when the auth token expires.
  • Consider implementing a workaround by keeping the underlying auth token perpetually fresh using a LaunchAgent, as described in the issue body.

Example

// Updated getAuthStatus() method:
return this.cachedCliAuthStatus ?? this.authManager.getAuthStatus();

Notes

  • The issue is specific to the Claude Code extension version 2.1.128 and may not apply to other versions.
  • The workaround using a LaunchAgent is specific to macOS and may not be applicable to other operating systems.

Recommendation

Apply the workaround by keeping the underlying auth token perpetually fresh using a LaunchAgent, as this prevents the symptom and allows for continued use of the extension while the underlying bug is fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING