Annoying AWS credential warning when both AWS_PROFILE and static credentials are present
User Story
As a developer using Claude Code alongside other AWS tools (like dbt, Terraform, etc.), I want to configure both AWS_PROFILE for Claude/Bedrock access and static credentials for other tools without receiving repetitive warnings, so that I can have a clean command-line experience.
Problem Description
Users receive this warning every time they run the claude command:
@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
Multiple credential sources detected:
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
This SDK will proceed with the AWS_PROFILE value.
However, a future version may change this behavior to prefer the ENV static credentials.
Please ensure that your environment only sets either the AWS_PROFILE or the
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
Why This Is Problematic
This is a very common scenario for developers who need:
AWS_PROFILEfor Claude Code (Bedrock access)AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYfor other tools (dbt, CI/CD pipelines, Terraform, etc.)
The warning is:
- ✅ Confusing: Suggests there's an error when both credentials are intentionally configured
- ✅ Repetitive: Appears every single time
claudeis run - ✅ Annoying: Creates noise in the command-line experience
- ✅ Misleading: Both credential types serve legitimate, different purposes
Steps to Reproduce
- Set
AWS_PROFILEin your environment (needed for Claude/Bedrock):
``bash``
export AWS_PROFILE=your-profile-name
- Set static AWS credentials (needed for other tools):
``bash``
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=secret...
- Run any
claudecommand:
``bash``
claude --version
- Result: Warning appears every time
Expected Behavior
- Ideal: No warning when both credential types are present (since this is a valid use case)
- Alternative: One-time informational message that can be suppressed
- Minimum: Less alarming warning message that acknowledges this is often intentional
Proposed Solutions
- Suppress AWS SDK warnings when both credential types are present (most user-friendly)
- Add configuration option to disable credential warnings (
--no-aws-warningsflag or config setting) - Improve warning message to be less alarming and acknowledge valid use cases
- Add documentation explaining this common multi-tool scenario
Environment
- OS: macOS (Darwin 24.6.0)
- Scenario: Developer using Claude Code + dbt + other AWS tooling
- Frequency: Every
claudecommand invocation
Impact
This affects any developer who:
- Uses Claude Code for AI assistance
- Uses other AWS tools requiring static credentials
- Values a clean command-line experience
Additional Context
This warning comes from the AWS SDK's credential provider, not Claude Code directly, but Claude Code could suppress or handle these warnings to improve user experience.
The warning is cosmetic only - Claude Code works perfectly fine, but the user experience is degraded by the constant warning noise.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗