[BUG] VS Code extension ignores apiKeyHelper from settings.json — falls back to Console OAuth
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- 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}')
- Run claude in terminal — CLI authenticates using the helper, responds to prompts
- Open the VS Code extension on the same machine
- Extension shows the "Sign in" screen instead of using the helper key
- 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
- Related: #26745 (same symptom on Claude Desktop / Windows / v2.1.47, auto-closed for inactivity), #12204 (root extension auth bug, still open 7 months)
- ANTHROPIC_API_KEY env var is NOT set. No conflicting auth state.
- Tested with a team member's machine, not just admin. Same result.
- Completing Console OAuth when user has Developer role creates an unmanaged key that breaks per-developer cost attribution. The only current mitigation is "don't use the extension."
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗