You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authentication token expiration causes request failures even after re-authentication #15137
Since approximately 3 days ago, I'm experiencing a critical authentication issue where session token expiration consistently causes request failures, even after successful re-authentication.
Bug Behavior:
Session token expires during normal usage (403 error: "The security token included in the request is expired")
Claude Code automatically attempts to re-authenticate (shows retry attempts: 1/10, 2/10, etc.)
Re-authentication appears to succeed
However, the original request still fails with the same token expiration error
This pattern repeats on every session expiration
Expected Behavior:
After successful re-authentication, the original request should be retried and succeed, not continue to fail with the same token expiration error.
Frequency:
This happens every single time a session expires - 100% reproduction rate.
Timeline:
Started: Approximately 3 days ago (around December 20, 2025)
Prior behavior: This issue did not occur before; re-authentication worked correctly
Environment:
Tool: Claude Code CLI
Model: claude-sonnet-4-5-20250929 (EU)
Platform: macOS (Darwin 24.6.0)
Date: December 23, 2025
Impact:
This forces manual intervention on every session expiration, significantly disrupting workflow and making the tool unreliable for longer sessions.
Suspected Cause:
The re-authentication mechanism appears to refresh the token, but the original failed request may not be properly retrying with the new token, instead continuing to use the expired token.
Have CC be in in non-bedrock mode (i.e. no "CLAUDE_CODE_USE_BEDROCK": "1" in the environment or settings.json).
Start it. Even with no API key or login it's fine, just starting it is all you need.
Prompt "Hello". It's fine if the prompt fails with no API key or or no /login
Set the AWS keys and token in the environment or settings.json and add "CLAUDE_CODE_USE_BEDROCK": "1"
This should work. Now use the agent until expiration or simply wait
When you get a 403 The security token included in the request is expired, exit CC
Get a new set of keys and token (or maybe just a token) and set them appropriately.
Restart CC
Send a prompt; if you are experiencing the issue (and everyone on my team is), you will STILL get the 403 The security token included in the request is expired even with the new token
Exit CC and remove or unset "CLAUDE_CODE_USE_BEDROCK": "1"
Start CC and send a prompt. Likley fail but with the normal no API key or /login message
Exit CC again and re-add "CLAUDE_CODE_USE_BEDROCK": "1"(recall that you already set the new AWS keys and token and haven't changed them - you only told CC not to use bedrock)
Start CC again and issue a prompt. Works fine and is correctly hitting bedrock again.
Somewhere, CC is storing the old token and not passign it to the current or new sessions until you actually disable bedrock mode entirely.
Perhaps it's this same problem that is the cause of #12421 as well.
@MWatter thanks for your reply and support! I just got it back to running again, the reason the security token was not taken over after re-auth, was that i had a wrong profile configured in my aws config file or better said, the profile that had worked in the past, was removed. Unfortunately therefore, i can not say, wether your solution would have helped my issue. Many thanks for your reply!! Much appreciated!
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Dec 23, 2025
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
matthieu-labs commentedon Dec 23, 2025
👎 issue not the same - as #10784 - please look into this
MWatter commentedon Jan 7, 2026
A little more context for this:
"CLAUDE_CODE_USE_BEDROCK": "1"in the environment or settings.json)./login"CLAUDE_CODE_USE_BEDROCK": "1"403 The security token included in the request is expired, exit CC403 The security token included in the request is expiredeven with the new token"CLAUDE_CODE_USE_BEDROCK": "1"/loginmessage"CLAUDE_CODE_USE_BEDROCK": "1"(recall that you already set the new AWS keys and token and haven't changed them - you only told CC not to use bedrock)Somewhere, CC is storing the old token and not passign it to the current or new sessions until you actually disable bedrock mode entirely.
Perhaps it's this same problem that is the cause of #12421 as well.
m-cla-trip commentedon Jan 7, 2026
@MWatter thanks for your reply and support! I just got it back to running again, the reason the security token was not taken over after re-auth, was that i had a wrong profile configured in my aws config file or better said, the profile that had worked in the past, was removed. Unfortunately therefore, i can not say, wether your solution would have helped my issue. Many thanks for your reply!! Much appreciated!
github-actions commentedon Feb 7, 2026
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
github-actions commentedon Feb 21, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 1, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.