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:
| Level | Meaning | Effect on the status area |
|---|---|---|
error | file unreadable or unusable, was rejected | “not in order”, details open |
warn | file was evaluated, but a sum does not add up | “not in order”, details open |
info | a check was skipped, no finding | none; 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
totalTokensfrom 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
totalsblock, field by field. Iftotalsis 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
dailyfield 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
totalsnor 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:
| Job | Runs | Warning when the last success is older than | Error when older than |
|---|---|---|---|
daily | daily at 04:00 | 36 hours | – |
rtk | daily at 04:15 | 36 hours | – |
weekly | Sundays at 04:30 | 8 days | the weekly run's lookback (default 14 days) |
monthly | on the 1st at 05:00 | from 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:
| Key | Likely cause | What you can do |
|---|---|---|
source.file.unreadable | export aborted, JSON incomplete | look at logs/<run>.log, repeat the run |
check.file.totals_missing | older file, or a source without totals | check; for monthly files, re-export the month |
check.day.token_sum_mismatch | ccusage exported inconsistently | re-export the month |
check.crosscheck.projects_days_missing | the project export started after old source data had expired | the gap is historical; restore it from a backup if one exists |
check.crosscheck.monthly_days_missing | monthly export incomplete | repeat the daily run |
check.crosscheck.cost_mismatch | Claude costs differ on shared days | repeat the daily run; for old partial days, restore from a backup |
check.crosscheck.skipped | monthly costs cannot be split by agent | re-export the month with model or agent breakdowns |
check.weekrun.skipped | weekly run aborted after the blocks | look at logs/weekly.log, repeat the weekly run |
check.rtk.duplicate_date | a date appears in two monthly files | look at the affected file, repeat the RTK run |
check.export.overdue | run missed or failed repeatedly, machine was off | look at logs/<job>.log, start the run by hand |
check.export.gap_risk | weekly run failed for longer than its lookback | run the call shown |
check.export.last_failed | last run with an exit code other than 0 | look at logs/<job>.log; the listed files are not current |
check.export.last_failed_no_targets | run stopped before any export, e.g. ccusage or rtk not found | look at logs/<job>.log, repeat the run |
check.export.last_failed_after_targets | all files written, a later step failed | look at logs/<job>.log; the data is current |
check.export.success_unrecorded | run succeeded, success file missing or damaged | look at logs/<job>.log, repeat the run |
check.export.future_timestamp | clock ran ahead, or status file edited | check the system clock, repeat the run |
check.export.never_logged | job has not run since status/ exists | wait for the next run or start it by hand |
check.export.status_missing | installation predates the status files, or demo mode | existing installation: ./install.sh --force (Windows: install.cmd --force) |
source.status.bad_file.<rule> | status file damaged or edited by hand | repeat the run; it rewrites the file |
How to start a run by hand is described under Export chain.