[BUG] The `/usage` command fails to show usage stats (stuck on "Loading usage data...") in sessions that have been idle for some time
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Running /usage within a Claude Code session does not show usage stats, if run in a session that's been idle (no messages sent) for a while, e.g. 1-3 hours or more. It gets stuck in a loading state ("Loading usage data..."):
<img width="462" height="212" alt="Image" src="https://github.com/user-attachments/assets/03a9dc39-3bc8-452c-ac65-b7a52c060ef4" />
Exiting and restarting the session allows /usage to start working again, as does sending a message to Claude within the idle session before running /usage. But it's not ideal to need to perform these workarounds just to check usage before continuing an idle session.
What Should Happen?
Running /usage should display usage stats, regardless of how long a session has been idle.
Error Messages/Logs
Steps to Reproduce
- Open a Claude Code session
- Run
/usageand see that it correctly displays usage stats - Leave the session idle for 1-3 hours
- Try to run
/usageagain, and see that it
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.101 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
This is the same bug described in #21637, which was auto-closed by the github-actions bot.
The bug occurs across platforms and apps (Mac, Windows, Terminal.app, iTerm2, VSCode / Cursor integrated shells, etc).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗