Description
When AWS Bedrock credentials expire during an active Claude Code session, the CLI becomes unresponsive instead of gracefully handling the authentication failure.
Expected Behavior
Claude Code should:
- Detect when AWS Bedrock credentials have expired
- Automatically attempt to refresh credentials, OR
- Display a clear error message prompting the user to re-authenticate
- Allow the session to recover after credentials are refreshed
Actual Behavior
Claude Code becomes stuck/unresponsive when credentials expire, requiring the user to:
- Manually terminate the session
- Refresh AWS credentials externally
- Restart Claude Code entirely
Steps to Reproduce
- Start a Claude Code session with valid AWS Bedrock credentials
- Wait for AWS credentials to expire (or manually expire them)
- Attempt to interact with Claude Code
- Observe that Claude Code becomes unresponsive
Environment
- Platform: macOS (Darwin 25.3.0)
- Shell: zsh
- Model: Sonnet 4.5 (us.anthropic.claude-sonnet-4-5-20250929-v1:0)
- Claude Code Interface: CLI
Impact
This significantly degrades the user experience, especially for:
- Long-running sessions
- Users with short-lived AWS session tokens
- SSO-based authentication that expires frequently
Suggested Solution
Implement credential refresh logic that:
- Catches AWS authentication errors (ExpiredToken, InvalidAccessKeyId, etc.)
- Attempts automatic credential refresh using the AWS SDK's credential chain
- Falls back to a user-friendly error message if automatic refresh fails
- Allows the session to continue after credentials are restored
Additional Context
This issue was reported during active development work where AWS SSO sessions expired mid-session, causing workflow interruption.
Description
When AWS Bedrock credentials expire during an active Claude Code session, the CLI becomes unresponsive instead of gracefully handling the authentication failure.
Expected Behavior
Claude Code should:
Actual Behavior
Claude Code becomes stuck/unresponsive when credentials expire, requiring the user to:
Steps to Reproduce
Environment
Impact
This significantly degrades the user experience, especially for:
Suggested Solution
Implement credential refresh logic that:
Additional Context
This issue was reported during active development work where AWS SSO sessions expired mid-session, causing workflow interruption.