anthropics / anthropics/claude-code
[BUG] Current session" usage shows high % on a fresh session despite ~12h of prior inactivity; confirmed at account level (claude.ai), not just local CLI display
- Lingua principale
- Python
- Stelle
- 145k
- Fork
- 23.1k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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?
Opened a brand-new Claude Code terminal session. The local /usage screen immediately showed:
Current session: 70% used
Resets 2:50pm (Europe/Berlin)
But the same /usage screen's own local session stats for that terminal instance read:
Total cost: $0.0000
Total duration (wall): 8s
Total code changes: 0 lines added, 0 lines removed
So this specific terminal instance had done essentially nothing, yet the session bar was already at 70%.
Last actual Claude usage before opening this session was approximately 12 hours earlier. Since the "current session" is documented as a rolling 5-hour window starting from the first message, a gap of ~12h should mean any prior window had already closed, and a new message should start a fresh window near 0%.
To rule out a purely local/CLI display bug, I checked claude.ai > Settings > Usage independently. It also shows elevated session usage (89% used at time of screenshot, "Resets in 2 hr 15 min"), confirming this is not just a stale/local counter in the CLI, the account-wide usage endpoint agrees.
### What Should Happen?
A fresh 5-hour rolling session window should start near 0% usage when there has been no activity in the preceding 5+ hours.
Actual Behavior
Session shows substantial usage (70%, later 89%) despite the described multi-hour gap in activity.
Environment
- Plan: Max (5x)
- Timezone: Europe/Berlin
- Claude Code (local /usage) and claude.ai web (Settings > Usage) both checked
### Error Messages/Logs
```shell
```
### Steps to Reproduce
1. Use Claude (any surface: claude.ai, Claude Code, etc.) normally, then stop using it entirely.
2. Wait approximately 12 hours with no further usage on any device or surface.
3. Open a brand-new Claude Code terminal session and run any command (e.g. a trivial prompt).
4. Immediately check `/usage` in the CLI.
Expected: Since the "current session" is a rolling 5-hour window starting from the first message, and it's been ~12h since any activity, the new window should start near 0%.
Observed: The CLI /usage screen showed "Current session: 70% used" immediately, despite this terminal instance's own local stats showing:
Total cost: $0.0000
Total duration (wall): 8s
Total code changes: 0 lines added, 0 lines removed
5. To rule out a local/CLI-only display bug, independently checked claude.ai > Settings > Usage on the same account.
Result: also showed elevated session usage (89% used, "Resets in 2 hr 15 min"), confirming the discrepancy exists at the account level, not just in the local CLI display.
### Claude Model
None
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
_No response_
### Claude Code Version
Current version: 2.1.258
### Platform
Anthropic API
### Operating System
macOS
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
_No response_
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Reproduce the report by waiting through the stated inactivity period, opening a new Claude Code terminal, and checking /usage. Compare those results with claude.ai > Settings > Usage to determine whether both surfaces show the same session state. Done means the new rolling session reports near-zero usage after the inactive period, consistently across both surfaces.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- macos
- Ambito
- api, cli
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100