Skip to main content

Checks and messages

The Token Usage Dashboard checks the data on every read and shows the result at the top of the page. The data comes from several export runs that can fail independently of each other. Without a cross-check, a half-written run would only surface when somebody doubts a number.

Token Usage Dashboard message levels​

The following table shows the Token Usage Dashboard message levels, their meaning and their effect on the status area:

LevelMeaningEffect on the status area
errorfile unreadable or unusable, was rejected“not in order”, details open
warnfile was evaluated, but a sum does not add up“not in order”, details open
infoa check was skipped, no findingnone; the message is only counted

info says “this could not be checked”. It does not turn the status area red, so you do not get used to red indicators. It stays visible all the same, so you do not mistake a skipped cross-check for a passed one.

Every message carries a key such as check.export.overdue. It appears next to the text in the message list and helps you find the message in the table What to do about a message.

Checks on the monthly files​

The Token Usage Dashboard checks the monthly files as follows:

  • Token sum per day: the sum of the four token fields against totalTokens from the file.
  • Cost per day: the sum of the model costs against totalCost, with a tolerance of $0.01 for rounding differences.
  • Per file: the sum of all days against the totals block, field by field. If totals is missing, the file cannot be checked. That is a finding in itself and is reported.
  • Rejected files: a file without readable JSON or without a daily field is rejected entirely. A single entry without a valid date is skipped and reported.

Checks on the extra sources​

For the extra sources, the Token Usage Dashboard runs these checks:

  • Project files against their totals: cost and all token fields.
  • Session files against their totals: cost.
  • Single block: the token fields against totalTokens, idle time excluded.
  • Blocks against sessions: both come from the same weekly run and must arrive at the same amount. They are compared only when both sources cover the same weeks. Otherwise the comparison is dropped, and the dashboard reports that as info. This happens when the weekly run aborted after the blocks.
  • Split by agent: the sum of the agent costs against the daily cost.
  • Projects against the monthly file: project files contain Claude only, monthly files other agents too. Only the Claude share is therefore compared. Missing days and differing costs are reported separately.
  • RTK: this source has neither totals nor cost. The checks are whether every date belongs to the month in the file name and whether every date occurs only once.

Export status in the Token Usage Dashboard​

Every run of the export chain leaves a status file in the status/ directory (see Data directory). From it the Token Usage Dashboard computes, on every request, the age of the last success per job. This check depends on the clock and is therefore current even when no file has changed.

The following table shows, for each export job, when it runs and at what age of the last success the Token Usage Dashboard warns or reports an error:

JobRunsWarning when the last success is older thanError when older than
dailydaily at 04:0036 hours–
rtkdaily at 04:1536 hours–
weeklySundays at 04:308 daysthe weekly run's lookback (default 14 days)
monthlyon the 1st at 05:00from the 2nd of a month, when the last success lies before the 1st of that month–

The rtk job is evaluated only when the rtk/ directory exists.

Looming data gap in the weekly run​

The Token Usage Dashboard monitors the weekly run in two stages. Between 8 days and the lookback, the next regular run still bridges the gap; you only see the warning check.export.overdue. Beyond that, the next run no longer reaches back far enough, and the error check.export.gap_risk replaces the warning.

The message names the call that closes the gap, written for the shell of your machine. On macOS and Linux it looks like this:

'<python>' '<data>/bin/ccusage-export.py' weekly --data-dir '<data>' --lookback-days <n>

On Windows, for PowerShell:

& '<python>' '<data>\bin\ccusage-export.py' weekly --data-dir '<data>' --lookback-days <n>

Run it before the roughly 31 days of source history under ~/.claude run out. After that, the period is irrecoverably lost, see Export chain.

Further export findings​

The Token Usage Dashboard also reports these export findings:

  • Last run failed: the last attempt ended with an exit code other than 0. The message says which files are affected, and whether the run aborted before the first export or only afterwards.
  • Success not recorded: the last run ended with 0, but the success file is missing, damaged or older.
  • Timestamp in the future: the clock ran ahead, or the status file was edited.
  • No run logged yet (info): status/ exists, but there is no file for the job yet.
  • No status (info): status/ is missing entirely. In demo mode this is intended.

What to do about a Token Usage Dashboard message​

The following table lists, for each Token Usage Dashboard message key, the likely cause and what you can do:

KeyLikely causeWhat you can do
source.file.unreadableexport aborted, JSON incompletelook at logs/<run>.log, repeat the run
check.file.totals_missingolder file, or a source without totalscheck; for monthly files, re-export the month
check.day.token_sum_mismatchccusage exported inconsistentlyre-export the month
check.crosscheck.projects_days_missingthe project export started after old source data had expiredthe gap is historical; restore it from a backup if one exists
check.crosscheck.monthly_days_missingmonthly export incompleterepeat the daily run
check.crosscheck.cost_mismatchClaude costs differ on shared daysrepeat the daily run; for old partial days, restore from a backup
check.crosscheck.skippedmonthly costs cannot be split by agentre-export the month with model or agent breakdowns
check.weekrun.skippedweekly run aborted after the blockslook at logs/weekly.log, repeat the weekly run
check.rtk.duplicate_datea date appears in two monthly fileslook at the affected file, repeat the RTK run
check.export.overduerun missed or failed repeatedly, machine was offlook at logs/<job>.log, start the run by hand
check.export.gap_riskweekly run failed for longer than its lookbackrun the call shown
check.export.last_failedlast run with an exit code other than 0look at logs/<job>.log; the listed files are not current
check.export.last_failed_no_targetsrun stopped before any export, e.g. ccusage or rtk not foundlook at logs/<job>.log, repeat the run
check.export.last_failed_after_targetsall files written, a later step failedlook at logs/<job>.log; the data is current
check.export.success_unrecordedrun succeeded, success file missing or damagedlook at logs/<job>.log, repeat the run
check.export.future_timestampclock ran ahead, or status file editedcheck the system clock, repeat the run
check.export.never_loggedjob has not run since status/ existswait for the next run or start it by hand
check.export.status_missinginstallation predates the status files, or demo modeexisting installation: ./install.sh --force (Windows: install.cmd --force)
source.status.bad_file.<rule>status file damaged or edited by handrepeat the run; it rewrites the file

How to start a run by hand is described under Export chain.