Skip to content

Feature Request: Show Error Message When Claude Usage Limit Is Reached #877

Closed as duplicate

Description

@heymaaz

Currently, when the Claude usage limit is reached, Opencode simply gets stuck at "working...". This makes it unclear to the user what has happened, and I have to manually open Claude to check if the usage limit has been reached.

Expected Behavior:
When the Claude usage limit is reached, Opencode should display a clear error message to the user indicating that the limit has been hit.

Current Behavior:

  • Opencode UI remains stuck at "working..."
  • No error message is shown
  • User must check Claude separately to diagnose the issue

Steps to Reproduce:

  1. Run Opencode with the Claude Sonnet 4 model:
    opencode run "explain the codebase" --model anthropic/claude-sonnet-4-20250514 --print-logs
  2. Hit the usage limit for Claude.
  3. Observe that Opencode gets stuck at "working..." with no error message.

Logs:

Last login: Fri Jul 11 10:08:57 on ttys010
maazchowdhry@MacBook-Pro chatbot_setup_zkk7ic % opencode run "explain the codebase" --model anthropic/claude-sonnet-4-20250514 --print-logs 2>&1 | tee opencode.log
INFO  2025-07-11T09:09:21 +29ms service=app cwd=/Users/maazchowdhry/Downloads/chatbot_setup_zkk7ic creating
INFO  2025-07-11T09:09:21 +0ms service=default version=0.2.27 args=run,explain the codebase,--model,anthropic/claude-sonnet-4-20250514,--print-logs opencode
INFO  2025-07-11T09:09:21 +0ms service=app cwd=/Users/maazchowdhry/Downloads/chatbot_setup_zkk7ic creating
INFO  2025-07-11T09:09:21 +1ms service=app git=/Users/maazchowdhry/Downloads/chatbot_setup_zkk7ic git
INFO  2025-07-11T09:09:21 +0ms service=app git=/Users/maazchowdhry/Downloads/chatbot_setup_zkk7ic git
INFO  2025-07-11T09:09:21 +1ms service=app name=config registering service
INFO  2025-07-11T09:09:21 +0ms service=bus type=storage.write subscribing
INFO  2025-07-11T09:09:21 +0ms service=app name=bus registering service
INFO  2025-07-11T09:09:21 +0ms service=format init
INFO  2025-07-11T09:09:21 +0ms service=bus type=file.edited subscribing
INFO  2025-07-11T09:09:21 +0ms service=config.hooks init
INFO  2025-07-11T09:09:21 +0ms service=bus type=file.edited subscribing
INFO  2025-07-11T09:09:21 +1ms service=bus type=session.idle subscribing
INFO  2025-07-11T09:09:21 +1ms service=app name=lsp registering service
INFO  2025-07-11T09:09:21 +0ms service=session id=ses_80740ed23ffe57CPWAbwv80O3P version=0.2.27 title=New Session - 2025-07-11T09:09:21.244Z time=[object Object] created
INFO  2025-07-11T09:09:21 +0ms service=app name=session registering service
INFO  2025-07-11T09:09:21 +0ms service=app name=storage registering service
INFO  2025-07-11T09:09:21 +1ms service=config loaded
INFO  2025-07-11T09:09:21 +0ms service=bus type=storage.write publishing
INFO  2025-07-11T09:09:21 +0ms service=app name=config registering service
INFO  2025-07-11T09:09:21 +0ms service=config loaded
INFO  2025-07-11T09:09:21 +0ms service=bus type=session.updated publishing

█▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀
█░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀
▀▀▀▀ █▀▀▀ ▀▀▀ ▀  ▀ ▀▀▀ ▀▀▀▀ ▀▀▀  ▀▀▀

>  explain the codebase

@  anthropic/claude-sonnet-4-20250514

INFO  2025-07-11T09:09:21 +1ms service=bus type=message.part.updated subscribing
INFO  2025-07-11T09:09:21 +0ms service=bus type=session.error subscribing
INFO  2025-07-11T09:09:21 +0ms service=app name=mode registering service
INFO  2025-07-11T09:09:21 +1ms service=session session=ses_80740ed23ffe57CPWAbwv80O3P chatting
INFO  2025-07-11T09:09:21 +0ms service=app name=provider registering service
INFO  2025-07-11T09:09:21 +1ms service=models.dev refreshing
INFO  2025-07-11T09:09:21 +0ms service=provider init
INFO  2025-07-11T09:09:21 +1ms service=provider providerID=openai found
INFO  2025-07-11T09:09:21 +0ms service=provider providerID=vercel found
INFO  2025-07-11T09:09:21 +0ms service=provider providerID=anthropic found
INFO  2025-07-11T09:09:21 +0ms service=provider providerID=github-copilot found
INFO  2025-07-11T09:09:21 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 getModel
INFO  2025-07-11T09:09:21 +0ms service=provider status=started providerID=anthropic getSDK
INFO  2025-07-11T09:09:21 +43ms service=provider status=completed duration=43 providerID=anthropic getSDK
INFO  2025-07-11T09:09:21 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 found
INFO  2025-07-11T09:09:21 +1ms service=session session=ses_80740ed23ffe57CPWAbwv80O3P sessionID=ses_80740ed23ffe57CPWAbwv80O3P locking
INFO  2025-07-11T09:09:21 +5ms service=bus type=storage.write publishing
INFO  2025-07-11T09:09:21 +0ms service=bus type=message.updated publishing
INFO  2025-07-11T09:09:21 +18ms service=bus type=storage.write publishing
INFO  2025-07-11T09:09:21 +0ms service=bus type=message.updated publishing
INFO  2025-07-11T09:09:21 +1ms service=app name=mcp registering service
INFO  2025-07-11T09:09:21 +2ms service=session session=ses_80740ed23ffe57CPWAbwv80O3P type=start part
INFO  2025-07-11T09:09:21 +2ms service=bus type=storage.write publishing
INFO  2025-07-11T09:09:21 +0ms service=bus type=message.updated publishing

Screenshots:

Image Image

Additional Context:
Improving this feedback would help users quickly understand the issue and avoid confusion.

Activity

  1. heymaaz commented on Jul 11, 2025

    @heymaaz
    Author
  2. v1truv1us commented on Jul 11, 2025

    @v1truv1us
    INFO  2025-07-11T13:59:52 +28ms service=app cwd=/Users/johnferguson/Github/rune creating
    INFO  2025-07-11T13:59:52 +1ms service=default version=0.2.27 args= opencode
    INFO  2025-07-11T13:59:52 +1ms service=app cwd=/Users/johnferguson/Github/rune creating
    INFO  2025-07-11T13:59:52 +0ms service=app git=/Users/johnferguson/Github/rune git
    INFO  2025-07-11T13:59:52 +0ms service=app git=/Users/johnferguson/Github/rune git
    INFO  2025-07-11T13:59:52 +1ms service=bus type=storage.write subscribing
    INFO  2025-07-11T13:59:52 +0ms service=app name=bus registering service
    INFO  2025-07-11T13:59:52 +0ms service=format init
    INFO  2025-07-11T13:59:52 +0ms service=bus type=file.edited subscribing
    INFO  2025-07-11T13:59:52 +0ms service=config.hooks init
    INFO  2025-07-11T13:59:52 +0ms service=bus type=file.edited subscribing
    INFO  2025-07-11T13:59:52 +0ms service=bus type=session.idle subscribing
    INFO  2025-07-11T13:59:52 +0ms service=app name=lsp registering service
    INFO  2025-07-11T13:59:52 +0ms service=app name=provider registering service
    INFO  2025-07-11T13:59:52 +1ms service=app name=config registering service
    INFO  2025-07-11T13:59:52 +0ms service=app name=config registering service
    INFO  2025-07-11T13:59:52 +1ms service=config $schema=https://opencode.ai/config.json model=antropic/claude-sonnet-4-20250514 mode=[object Object] mcp=[object Object] instructions=.cursor/rules/*.md* loaded
    INFO  2025-07-11T13:59:52 +1ms service=config $schema=https://opencode.ai/config.json model=antropic/claude-sonnet-4-20250514 mode=[object Object] mcp=[object Object] instructions=.cursor/rules/*.md* loaded
    INFO  2025-07-11T13:59:52 +0ms service=models.dev refreshing
    INFO  2025-07-11T13:59:52 +0ms service=provider init
    INFO  2025-07-11T13:59:52 +2ms service=provider providerID=github-copilot found
    INFO  2025-07-11T13:59:52 +0ms service=provider providerID=anthropic found
    INFO  2025-07-11T13:59:52 +3ms service=default cmd=/Users/johnferguson/.cache/opencode/tui/tui-dh3235x4. tui
    INFO  2025-07-11T13:59:52 +0ms service=app name=mode registering service
    INFO  2025-07-11T13:59:52 +15ms service=server method=GET path=/config request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:52 +1ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:52 +2ms service=server method=GET path=/file/status request
    INFO  2025-07-11T13:59:52 +1ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +1ms service=server duration=1 response
    INFO  2025-07-11T13:59:52 +0ms service=server method=GET path=/event request
    INFO  2025-07-11T13:59:52 +0ms service=server event connected
    INFO  2025-07-11T13:59:52 +1ms service=bus type=* subscribing
    INFO  2025-07-11T13:59:52 +1ms service=server duration=2 response
    INFO  2025-07-11T13:59:52 +0ms service=server method=GET path=/config/providers request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:52 +2ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +1ms service=server duration=1 response
    INFO  2025-07-11T13:59:52 +14ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:52 +2ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +1ms service=server duration=1 response
    INFO  2025-07-11T13:59:52 +5ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:52 +3ms service=server method=POST path=/log request
    INFO  2025-07-11T13:59:52 +0ms service=server duration=0 response
    INFO  2025-07-11T13:59:53 +230ms service=server duration=262 response
    INFO  2025-07-11T13:59:55 +2798ms service=server method=GET path=/session request
    INFO  2025-07-11T13:59:55 +1ms service=app name=storage registering service
    INFO  2025-07-11T13:59:55 +2ms service=app name=session registering service
    INFO  2025-07-11T13:59:56 +13ms service=server duration=16 response
    INFO  2025-07-11T14:00:15 +19166ms service=bus type=* unsubscribing
    INFO  2025-07-11T14:00:15 +0ms service=server event disconnected
    INFO  2025-07-11T14:00:15 +1ms service=app name=lsp shutdown
    INFO  2025-07-11T14:00:15 +0ms service=app name=session shutdown
    

    these are the only logs i'm able to find for the time frame when I attempted a request when i had run out of tokens. i verified that I got the error in claude-code as well

  3. self-assigned this
    on Jul 12, 2025
  4. jfogarty-rlg commented on Aug 1, 2025

    @jfogarty-rlg

    ideally, we would get a warning ahead of time, that we are getting closer to our limit, claude code can do it, as can a number of vs code plugins, so the API calls to claude has the limit as part of the return information.

  5. cstyan commented on Aug 16, 2025

    @cstyan

    This would be really useful to have. At the moment, when you auth via claude code pro, even in anthropics console you cannot see your usage relative to the limit (their console thinks I have 0 usage at the moment?). Not sure if that's auth/token related or just a result of using something other than one of their apps directly

    but having some feedback in opencode that you have hit the limit or are nearing it would be useful

  6. ahmet-cetinkaya commented on Oct 6, 2025

    @ahmet-cetinkaya

    If a rate limit or quota error occurs, it should be visible immediately, without waiting for the prompt to hit a timeout. Implementing a TUI to visualize various usage statistics—similar to the ryoppippi/ccusage project—would be extremely helpful for monitoring and diagnostics.

  7. rekram1-node commented on Oct 6, 2025

    @rekram1-node
    Contributor

    yes totally agree, we have dropped the ball on this, team has been super busy tackling a few big things, maybe I can take a stab at this soon if I get some time

  8. rekram1-node commented on Oct 11, 2025

    @rekram1-node
    Contributor

    marking as dup of #777

  9. dbkblk commented on Nov 10, 2025

    @dbkblk

    While you work on it, would it be possible to also add the time to wait for the usage limit to reset and wait before to send the request automatically on reset ?

  10. rekram1-node commented on Nov 10, 2025

    @rekram1-node
    Contributor

    @dbkblk are u saying display the time? or automatically wait until quota resets to retry?

  11. dbkblk commented on Nov 10, 2025

    @dbkblk

    Both :) But most importantly, the time to wait.

  12. rekram1-node commented on Nov 10, 2025

    @rekram1-node
    Contributor

    @dbkblk we already do the wait until quota resets unless it is in "distant" future

    As for showing it, yeah totally agree need that v soon

  13. dbkblk commented on Nov 11, 2025

    @dbkblk

    @dbkblk we already do the wait until quota resets unless it is in "distant" future

    As for showing it, yeah totally agree need that v soon

    Oh that's nice to know! Thank you for this really good software you've made :)

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