Skip to content

Claude subscription token expires after a period of time #6559

Closed as not planned

Description

@leeweisern

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.

Image

OpenCode version

1.0.220

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jan 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. aldaw commented on Jan 3, 2026

    @aldaw

    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.
    Image

  3. n2k3 commented on Jan 5, 2026

    @n2k3

    Same for me for new sessions after a while (usually next day)

    Image

    I have to re-prompt for it to actually refresh the token.

  4. drjagan commented on Jan 13, 2026

    @drjagan

    I have the same issue. Re-Prompting did not help.

  5. mehow28 commented on Jan 14, 2026

    @mehow28

    Just had this issue - re-prompting did not help, had to re-connect provider (claude - opencode dekstop win11 25H2)

  6. pranshuchittora commented on Jan 14, 2026

    @pranshuchittora

    Encountered the same,
    Image

    Now my morning routine includes re-login.

  7. bzbetty commented on Jan 14, 2026

    @bzbetty

    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

  8. simonsankar commented on Jan 16, 2026

    @simonsankar

    how long does it last? is this meant to happen from Anthropic's side? that it expires?

  9. xtfer commented on Jan 21, 2026

    @xtfer

    Not sure that just closing the patch and walking away is going to fly...

  10. iamkhullar commented on Jan 22, 2026

    @iamkhullar

    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

  11. prolific commented on Feb 7, 2026

    @prolific

    Facing the same issue. This is getting very annoying.

  12. abehuman commented on Feb 14, 2026

    @abehuman

    same.

    i need to always delete Anthropic provider and add it again. This is not good experience.

  13. akarabach commented on Feb 16, 2026

    @akarabach

    the same

  14. m1chu commented on Feb 17, 2026

    @m1chu

    Same problem.

  15. alpham commented on Feb 17, 2026

    @alpham

    same here as well.

  16. then3rdman commented on Feb 23, 2026

    @then3rdman
    Image

    Hoping this float to the top of the pile... horrid UX having to delete and reauth everyday....

  17. EzequielMonforte commented on Feb 23, 2026

    @EzequielMonforte

    Same error

  18. SlimG commented on Feb 25, 2026

    @SlimG

    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.

  19. pranshuchittora commented on Feb 25, 2026

    @pranshuchittora

    Let me re-iterate the fix opencode-anthropic-auth should point to the latest version

    ~/.config/opencode/opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-anthropic-auth@latest"]
    }

    EDIT - opencode-anthropic-auth has been marked as deprecated. :(

  20. Moelanz commented on Mar 4, 2026

    @Moelanz

    Same issue here, need to authenticate every day

  21. mmircoli-nexapp commented on Mar 11, 2026

    @mmircoli-nexapp

    I have the same problem, any solution

  22. mbuferli commented on Mar 17, 2026

    @mbuferli

    +1

  23. removed
    bugSomething isn't working
    on May 3, 2026
  24. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions