[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
- In
.aws/configadd a custom profile for auth, that calls a script
[profile custom-auth]
credential_process = /home/mickael/.claude/scripts/aws_creds.sh
- Confirm it is working :
aws sts get-caller-identity --profile custom-auth - Add
AWS_PROFILEto.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"
}
- Running
claude --debugand then promptingtestjust hangs, and the debug log shows the errors above - Exit, manually set the environment variable :
export AWS_PROFILE=custom-auth - Running
claudeand promptingtestnow 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
- I feel like this is somehow related to #5418.
- I also tried with
CLAUDE_CODE_AWS_PROFILEas I was not sure which it is supposed to be. - 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
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗