claude-code - 💡(How to fix) Fix [BUG] VS Code extension in Codespaces fails Bedrock auth with "Could not load credentials from any providers" while same Claude binary works from shell

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…

In GitHub Codespaces, Claude Code fails to use AWS Bedrock credentials when prompts are sent through the VS Code extension UI.

The same bundled claude binary works correctly when launched manually from the shell in the same Codespace.

The failure only happens on the VS Code extension path (cc_entrypoint=claude-vscode), while the CLI path (cc_entrypoint=cli) succeeds.

Error Message

Error Messages/Logs

API error (attempt N/11): Could not load credentials from any providers API error (attempt 1/11): Could not load credentials from any providers [ERROR] API error (attempt 1/11): Could not load credentials from any providers 2026-04-20 11:29:42.070 [info] From claude: 2026-04-20T11:29:42.069Z [ERROR] API error (attempt 1/11): Could not load credentials from any providers

Root Cause

In GitHub Codespaces, Claude Code fails to use AWS Bedrock credentials when prompts are sent through the VS Code extension UI.

The same bundled claude binary works correctly when launched manually from the shell in the same Codespace.

The failure only happens on the VS Code extension path (cc_entrypoint=claude-vscode), while the CLI path (cc_entrypoint=cli) succeeds.

Code Example

Prompts sent through the VS Code extension fail with:


API error (attempt N/11): Could not load credentials from any providers
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?

Summary

In GitHub Codespaces, Claude Code fails to use AWS Bedrock credentials when prompts are sent through the VS Code extension UI.

The same bundled claude binary works correctly when launched manually from the shell in the same Codespace.

The failure only happens on the VS Code extension path (cc_entrypoint=claude-vscode), while the CLI path (cc_entrypoint=cli) succeeds.

What Should Happen?

The VS Code extension should be able to use the same AWS Bedrock credentials that are already visible to the Claude process it launches, and prompts should succeed just like they do from CLI.

Error Messages/Logs

Prompts sent through the VS Code extension fail with:


API error (attempt N/11): Could not load credentials from any providers

Steps to Reproduce

  1. Open a GitHub Codespace.

  2. Configure AWS Bedrock credentials in the Codespace/container environment.

  3. Install and open the Claude Code VS Code extension.

  4. Send a prompt through the extension UI, for example:

    say hello
  5. Observe repeated failures:

    API error (attempt 1/11): Could not load credentials from any providers
  6. In the same Codespace, launch the bundled Claude binary manually from the shell:

    /home/codespace/.vscode-remote/extensions/anthropic.claude-code-2.1.114-linux-x64/resources/native-binary/claude \
      --output-format stream-json \
      --verbose \
      --input-format stream-json \
      --max-thinking-tokens 31999 \
      --permission-prompt-tool stdio \
      --setting-sources=user,project,local \
      --permission-mode default \
      --debug \
      --debug-to-stderr \
      --enable-auth-status \
      --no-chrome \
      --replay-user-messages
  7. Send a prompt through that CLI session.

  8. Observe that the request succeeds.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.114 (Claude Code)

Platform

AWS Bedrock

Operating System

Other Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Key difference seen in logs

Working path

The working run is tagged as:

cc_entrypoint=cli

It successfully reaches Bedrock:

[API REQUEST] /model/us.anthropic.claude-sonnet-4-6/invoke-with-response-stream source=repl_main_thread
[DEBUG] Stream started - received first chunk

Failing path

The failing extension run is tagged as:

cc_entrypoint=claude-vscode

And then fails with:

[ERROR] API error (attempt 1/11): Could not load credentials from any providers

Failing VS Code extension log excerpt

2026-04-20 11:29:42.056 [info] From claude: 2026-04-20T11:29:42.056Z [DEBUG] attribution header x-anthropic-billing-header: cc_version=2.1.114.5ad; cc_entrypoint=claude-vscode;

2026-04-20 11:29:42.057 [info] From claude: 2026-04-20T11:29:42.057Z [DEBUG] [API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: false, has Authorization header: false
2026-04-20T11:29:42.057Z [DEBUG] [API:auth] OAuth token check starting

2026-04-20 11:29:42.058 [info] From claude: 2026-04-20T11:29:42.058Z [DEBUG] [API:auth] OAuth token check complete

2026-04-20 11:29:42.070 [info] From claude: 2026-04-20T11:29:42.069Z [ERROR] API error (attempt 1/11): Could not load credentials from any providers

Working CLI log excerpt

2026-04-20T11:32:36.533Z [DEBUG] attribution header x-anthropic-billing-header: cc_version=2.1.114.5ad; cc_entrypoint=cli;
2026-04-20T11:32:36.567Z [DEBUG] [API REQUEST] /model/us.anthropic.claude-sonnet-4-6/invoke-with-response-stream source=repl_main_thread
2026-04-20T11:32:38.419Z [DEBUG] Stream started - received first chunk

Why this looks extension-specific

  • Same Codespace
  • Same container
  • Same AWS credentials
  • Same bundled Claude binary
  • Same Bedrock target
  • CLI works
  • VS Code extension path fails

That suggests a bug or auth/provider-chain mismatch specific to the claude-vscode entrypoint rather than a general AWS or Bedrock configuration issue.

Related issues

Possibly related in symptom/auth area, but not the same issue:

  • anthropics/claude-code-action#1090
  • anthropics/claude-code#29765

Additional notes

I can provide fuller logs if helpful, but the main repro is reliable:

  • VS Code extension UI fails
  • manual CLI launch succeeds
  • spawned extension claude process already sees the AWS credentials

extent analysis

TL;DR

The issue can likely be resolved by ensuring the VS Code extension properly inherits or sets the environment variables for AWS Bedrock credentials.

Guidance

  1. Verify Environment Variables: Check if the AWS Bedrock credentials are set as environment variables in the Codespace and if these variables are accessible to the VS Code extension.
  2. Extension Configuration: Review the VS Code extension's configuration to ensure it is set up to use the correct credentials or to inherit the environment variables from the Codespace.
  3. Debug Logging: Enable more detailed debug logging in the VS Code extension to see if there are any specific errors or hints about why the credentials cannot be loaded.
  4. Compare CLI and Extension Environments: Since the CLI works, compare the environment variables and settings used by the CLI launch with those used by the VS Code extension launch to identify any discrepancies.

Example

No specific code example is provided due to the lack of direct code references in the issue, but a potential step could involve setting environment variables in the VS Code extension's launch configuration, such as:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Claude Code Extension",
      "type": "node",
      "request": "launch",
      "program": "${workspaceFolder}/claude-vscode.js",
      "env": {
        "AWS_ACCESS_KEY_ID": "${env:AWS_ACCESS_KEY_ID}",
        "AWS_SECRET_ACCESS_KEY": "${env:AWS_SECRET_ACCESS_KEY}"
      }
    }
  ]
}

This example assumes a Node.js launch configuration and attempts to pass through AWS credentials as environment variables.

Notes

The solution may depend on how the VS Code extension is configured to interact with the environment variables set in the Codespace. Ensuring that the extension has access to the necessary credentials is key.

Recommendation

Apply a workaround by explicitly setting the environment variables for AWS Bedrock credentials in the VS Code extension's configuration, as the issue seems to stem from the extension not inheriting these variables correctly from the Codespace environment.

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

claude-code - 💡(How to fix) Fix [BUG] VS Code extension in Codespaces fails Bedrock auth with "Could not load credentials from any providers" while same Claude binary works from shell