Claude subscription token expires after a period of time
Description
Usually it happens when i stopped using for a while. e.g: 12 hours. The first session i talk to Claude, I will get Error: Token refresh failed: 400
i have to type something random, and then it works. This is a minor issue, but i am using opencode as a remote agent. So it affects the user experience.
From what i am seeing, the token expires, it throws the errors but the refresh token actually succeeds.
So the user have to manually send another message for it to continue.
OpenCode version
1.0.220
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #4992: Getting "Unauthorized: token expired" during conversation - Similar token expiration issue during active sessions
- #6083: Token refresh failed: 403 failed with github copilot - Token refresh failures with Anthropic/GitHub Copilot providers
Feel free to ignore if none of these address your specific case.
I got the same error after around 10 hours, laptop and my self went to sleep. And then I get this error at first prompt.
Same for me for new sessions after a while (usually next day)
I have to re-prompt for it to actually refresh the token.
I have the same issue. Re-Prompting did not help.
Just had this issue - re-prompting did not help, had to re-connect provider (claude - opencode dekstop win11 25H2)
Encountered the same,
Now my morning routine includes re-login.
I hit this most days too, which unfortunately is often followed by #8529 which makes it a bit more of a chore to re-login
how long does it last? is this meant to happen from Anthropic's side? that it expires?