[BUG] /usage shows stale cached percentage when multiple sessions are open on the same account
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
The report identifies /usage and stale account-wide usage across sessions, but names no implementation files or tests. Start by tracing the /usage command and how it retrieves or caches usage, then look for tests covering repeated requests or multiple sessions. Done when rerunning /usage in either session reports the same current usage after activity in the other.
Written by the indexing model from the issue text.
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report
- I am using the latest version of Claude Code (on 2.1.308; latest is 2.1.326 — not yet retested there)
What's Wrong?
When more than one Claude Code session is open on the same account, /usage in one session keeps showing an old value after usage has gone up in another session.
Session A shows the percentage it got the first time it ran /usage (e.g. 80%). Running /usage again in A shows the same number, even after heavy work in session B. Session B, which did the work, shows the correct higher value.
What Should Happen?
/usage is an explicit request, so it should fetch the current account-wide usage every time it runs, whichever session it runs in. At minimum it should not serve a cached value that is older than activity from another session on the same account.
Error Messages/Logs
No error. /usage shows a stale percentage.
Steps to Reproduce
- Open two Claude Code sessions (A and B) signed in to the same account.
- Run
/usagein session A. It shows e.g. 80%. - Do a lot of work in session B so usage goes up.
- Run
/usagein session B. It shows the new, higher value. - Run
/usageagain in session A.
Actual: Session A still shows the old value (80%).
Expected: Session A shows the same current value as session B.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.308 (Claude Code)
Platform
Anthropic API (claude.ai subscription login)
Operating System
macOS (26.6.2)
Terminal/Shell
Other: Claude Code VS Code extension
Additional Information
Impact: Users can think they still have usage left when they don't, and then hit the limit without warning in the middle of work.
Related but separate: #75408 covers the statusline rate_limits.used_percentage drifting across concurrent terminals. That issue says /usage does a fresh check. This report is that /usage itself returns a stale value in the session that did not do the work.
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 25k
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/claude-code
-
area:hooks area:plugins bug has repro platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111771 ·
-
area:docs bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111658 ·
-
area:core bug platform:linux platform:wsl regression
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anthropics/claude-code#111548 ·
-
area:vscode bug has repro platform:vscode platform:windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anthropics/claude-code#111416 ·
-
area:plugins area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111195 ·
All issues in anthropics/claude-code
Similar issues
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
bug extension mcp
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primer/primitives#1426 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2941 ·
Maintainers usually reply within 4 days