[BUG] AWS_PROFILE in settings.json not working

Resolved 💬 6 comments Opened Oct 19, 2025 by K3UL Closed Jan 12, 2026

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?

When I set the environment variable AWS_PROFILE in the global settings, it is not used. If I set it directly in my system (with export ) it works.

What Should Happen?

I should be able to use authentication with custom profile and set it in the claude code settings, in order to not interfere with aws commands outside of Claude Code.

Error Messages/Logs

When using the settings file to set the variable, the debug file contains the following : 

[ERROR] Error streaming, falling back to non-streaming mode: Could not load credentials from any providers
[ERROR] Error streaming, falling back to non-streaming mode: Could not load credentials from any providers

Steps to Reproduce

  1. In .aws/config add a custom profile for auth, that calls a script
[profile custom-auth]
credential_process = /home/mickael/.claude/scripts/aws_creds.sh
  1. Confirm it is working : aws sts get-caller-identity --profile custom-auth
  2. Add AWS_PROFILE to .claude/settings.json
{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "DISABLE_PROMPT_CACHING": "1",
    "AWS_PROFILE": "custom-auth"
  },
  "model": "eu.anthropic.claude-3-7-sonnet-20250219-v1:0"
}
  1. Running claude --debug and then prompting test just hangs, and the debug log shows the errors above
  2. Exit, manually set the environment variable : export AWS_PROFILE=custom-auth
  3. Running claude and prompting test now works and gets a response

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.22

Platform

AWS Bedrock

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

  1. I feel like this is somehow related to #5418.
  2. I also tried with CLAUDE_CODE_AWS_PROFILE as I was not sure which it is supposed to be.
  3. This probably worked before as it was mentioned in #148 in this comment https://github.com/anthropics/claude-code/issues/148#issuecomment-2852648857 but I never tried it before

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗