Skip to content

[BUG] VS Code extension ignores apiKeyHelper from settings.json — falls back to Console OAuth #38314

Description

@dimidir

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?

apiKeyHelper in ~/.claude/settings.json is not picked up by the VS Code extension. The CLI reads it and authenticates correctly. The extension behaves as if the setting doesn't exist — it shows the Console OAuth login prompt on first launch.
If the user completes the OAuth flow and has the Developer role in the Anthropic API org, the Console silently auto-generates a new API key. The user never asked for this key, and it's not the one the admin provisioned.

What Should Happen?

The extension should use the apiKeyHelper command from ~/.claude/settings.json to authenticate — same as the CLI does. No OAuth prompt, no auto-generated keys.

The https://code.claude.com/docs/en/settings list apiKeyHelper as a standard setting. The https://code.claude.com/docs/en/vs-code state that ~/.claude/settings.json is "shared between the extension and CLI." No carve-out is documented.

Error Messages/Logs

No error. The extension silently ignores apiKeyHelper and shows the login screen as if the setting doesn't exist.

Steps to Reproduce

  1. Configure apiKeyHelper in ~/.claude/settings.json with a command that returns a valid API key (e.g., op item get 'dev-delivery-{name}' --fields password --reveal --vault 'Anthropic - {Name}')
  2. Run claude in terminal — CLI authenticates using the helper, responds to prompts
  3. Open the VS Code extension on the same machine
  4. Extension shows the "Sign in" screen instead of using the helper key
  5. If you complete Console OAuth and the user has Developer role in the API org, a new key is auto-generated instead of using the admin-provisioned one

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.81 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions