claude-code - 💡(How to fix) Fix [BUG] Resumed sessions attribute new token usage to the original session-creation date in Desktop Model Usage view [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54574Fetched 2026-04-30 06:41:55
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

N/A — no error is produced. This is a reporting/attribution bug, not a runtime failure.

Code Example

N/A — no error is produced. This is a reporting/attribution bug, not a runtime failure.

---

2.1.123 (Claude Code)
RAW_BUFFERClick to expand / collapse

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

What's Wrong?

When a session is resumed days after its creation, all token usage generated during the resumed conversation is reported under the original session-creation date instead of the actual date the tokens were consumed. This is visible in the Claude desktop app under Settings → Usage / Model Usage, where the daily totals roll up onto the wrong calendar day. The status line / context counter inside Claude Code reflects the same misattribution. The result is that "today's" usage looks artificially low and a past day appears to retroactively gain usage that did not occur on that day.

What Should Happen?

Token usage should be attributed to the calendar date on which the tokens were actually consumed (the date of each individual request/response), not the date the session was originally created. Resuming an old session via claude --resume should add today's tokens to today's bucket in the Desktop Model Usage view (and any other usage surfaces).

Error Messages/Logs

N/A — no error is produced. This is a reporting/attribution bug, not a runtime failure.

Steps to Reproduce

  1. On Day 1, run claude to start a new session in any directory. Send one or more prompts so token usage is recorded. Exit.
  2. Open the Claude desktop app → Settings → Usage / Model Usage. Note Day 1's totals. Confirm Day 2 (and subsequent days) show 0 tokens for this work.
  3. Wait at least 24 hours (a longer gap, e.g. 3–5 days, makes the misattribution more obvious).
  4. On Day N (N ≥ 2), run claude --resume and select the session created on Day 1. Send several new prompts so a meaningful number of tokens is consumed today.
  5. Exit, then reopen the Claude desktop app → Settings → Usage / Model Usage.

Observed: Day 1's total has grown by the tokens just consumed on Day N. Day N still shows 0 (or only shows tokens from non-resumed sessions started today). Expected: Day N's total should reflect the tokens consumed today; Day 1's total should be unchanged after Day 1 ended.

This is fully deterministic and reproduces every time on a freshly resumed old session.

Claude Model

Not sure / Multiple models (reproduces regardless of model selection)

Is this a regression?

I don't know

Claude Code Version

2.1.123 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • macOS 26.4.1 (Darwin 25.4.0, arm64)
  • Shell: zsh
  • The bug is purely in usage reporting/attribution; the conversation itself resumes correctly and the API requests succeed normally.
  • The misattribution is consistent between the in-CLI status display and the Desktop app's Model Usage overview, suggesting both surfaces source the per-day totals from the session's creation timestamp rather than per-request timestamps.

extent analysis

TL;DR

The issue can be resolved by modifying the token usage reporting to attribute tokens to the date of each individual request/response instead of the session creation date.

Guidance

  • Verify that the session's creation timestamp is being used for token usage reporting by checking the code that updates the usage statistics.
  • Investigate the claude --resume command to ensure it is correctly updating the session's state to reflect the current date.
  • Consider adding a timestamp to each request/response to accurately track token usage over time.
  • Review the Desktop app's Model Usage view to ensure it is displaying the correct daily totals based on the request/response timestamps.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue seems to be related to the way token usage is reported and attributed to sessions. The fact that the misattribution is consistent between the in-CLI status display and the Desktop app's Model Usage overview suggests a common source of data.

Recommendation

Apply a workaround to modify the token usage reporting to attribute tokens to the date of each individual request/response instead of the session creation date, as this is the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Resumed sessions attribute new token usage to the original session-creation date in Desktop Model Usage view [1 comments, 2 participants]