[BUG] AWS token expires frequently in Claude Code

Resolved 💬 10 comments Opened Apr 22, 2025 by pasky Closed May 2, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.76 (Claude Code)
  • Operating System: MacOS 15.3.2 (24D81)
  • Terminal: iTerm 2

Bug Description

Claude frequently fails with "API Error: The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile."

Running aws sso login indeed fixes the issue for a while, but the issue comes back in an hour or two - much sooner than what's our standard AWS token expiry time (4h - and with autorefresh, it can last for more than 12h as that's Okta session lifetime).

Meanwhile, other aws commands (or coding assistants using bedrock; aws CLI or boto3 based) keep working fine on the same box while Claude is erroring out. It seems like Claude is doing something non-standard - how are you interfacing with AWS?

<img width="1219" alt="Image" src="https://github.com/user-attachments/assets/e570907b-9765-46a3-a10d-f45442492a11" />

View original on GitHub ↗

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