[BUG] /usage shows stale cached percentage when multiple sessions are open on the same account

Open
#110,587 0 comments 0 reactions 0 assignees View on GitHub

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

area:cost bug has repro platform:macos platform:vscode
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
  1. Open two Claude Code sessions (A and B) signed in to the same account.
  2. Run /usage in session A. It shows e.g. 80%.
  3. Do a lot of work in session B so usage goes up.
  4. Run /usage in session B. It shows the new, higher value.
  5. Run /usage again 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

Open in Codespaces

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.