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
Claude subscription token expires after a period of time #6559
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.
i face this issue multiple times in past few days - goto opencode cli > have to connect the provider again > authenticate claude and then restart the opencode app - this fixes it but for some time
No idea if it is of relevance, but the next day my OpenCode usually allows me to send the first prompt and get a response from Claude. The second and subsequent prompts trigger "Error: Token refresh failed: 400" until I manually reconnect to Anthropic.
Activity
github-actions commentedon Jan 1, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
aldaw commentedon Jan 3, 2026
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.

n2k3 commentedon Jan 5, 2026
Same for me for new sessions after a while (usually next day)
I have to re-prompt for it to actually refresh the token.
drjagan commentedon Jan 13, 2026
I have the same issue. Re-Prompting did not help.
mehow28 commentedon Jan 14, 2026
Just had this issue - re-prompting did not help, had to re-connect provider (claude - opencode dekstop win11 25H2)
pranshuchittora commentedon Jan 14, 2026
Encountered the same,

Now my morning routine includes re-login.
bzbetty commentedon Jan 14, 2026
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
simonsankar commentedon Jan 16, 2026
how long does it last? is this meant to happen from Anthropic's side? that it expires?
xtfer commentedon Jan 21, 2026
Not sure that just closing the patch and walking away is going to fly...
iamkhullar commentedon Jan 22, 2026
i face this issue multiple times in past few days - goto opencode cli > have to connect the provider again > authenticate claude and then restart the opencode app - this fixes it but for some time
prolific commentedon Feb 7, 2026
Facing the same issue. This is getting very annoying.
abehuman commentedon Feb 14, 2026
same.
i need to always delete Anthropic provider and add it again. This is not good experience.
akarabach commentedon Feb 16, 2026
the same
m1chu commentedon Feb 17, 2026
Same problem.
alpham commentedon Feb 17, 2026
same here as well.
then3rdman commentedon Feb 23, 2026
Hoping this float to the top of the pile... horrid UX having to delete and reauth everyday....
EzequielMonforte commentedon Feb 23, 2026
Same error
SlimG commentedon Feb 25, 2026
No idea if it is of relevance, but the next day my OpenCode usually allows me to send the first prompt and get a response from Claude. The second and subsequent prompts trigger "Error: Token refresh failed: 400" until I manually reconnect to Anthropic.
pranshuchittora commentedon Feb 25, 2026
Let me re-iterate the fix
opencode-anthropic-authshould point to the latest version~/.config/opencode/opencode.json{ "$schema": "https://opencode.ai/config.json", "plugin": ["opencode-anthropic-auth@latest"] }EDIT -
opencode-anthropic-authhas been marked as deprecated. :(Moelanz commentedon Mar 4, 2026
Same issue here, need to authenticate every day
mmircoli-nexapp commentedon Mar 11, 2026
I have the same problem, any solution
mbuferli commentedon Mar 17, 2026
+1
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.