Setup guide · 4 min read
Track Claude Code usage across your machines
Install nothing globally. Preview your local usage, approve a device, and keep one profile for the machines you work on.
By claudeusage · Updated
Check your local history first
You need Node.js 22 or newer and local Claude Code usage logs. The CLI reads the projects directory inside your Claude configuration directory. It can only report detailed records that still exist on that machine.
Start with doctor to see whether the CLI finds your logs. A missing date is often a coverage issue rather than a calculation issue. A legacy stats cache is diagnostic information, not a substitute for detailed records.
npx claudeusage-sync doctorPreview the upload
The dry run shows the aggregate payload without uploading usage. It lets you inspect date buckets, token counts, model identifiers, and estimated active hours before you connect a device.
Prompts, responses, and source code are not fields in the upload schema. In the updated CLI, filesystem paths reported as model names are replaced with local-model. The CLI source is public so you can inspect its behavior.
npx claudeusage-sync --dry-runApprove the device once
Run the sync command. On first use, it opens a browser approval page. Sign in to the claudeusage account you want to use, choose your public identity, and approve that device. The CLI stores a sync token locally for later uploads.
Detailed website analytics have a paid membership with a 14-day trial. The trial requires a card and renews automatically unless canceled. Review the amount and renewal date in the billing screen before starting it.
npx claudeusage-syncAdd a second machine
Run the same command on the second machine and approve it while signed into the same website account. Each machine uploads the records it holds. Do not copy the same session archive between machines and expect cross-machine deduplication: the overlap guard is scoped to a machine.
Later runs reuse the saved token and upload new records. Refreshing the website reads uploaded data only. It cannot read your laptop's files or run a local sync for you.
When something looks missing
Run doctor again and compare its coverage with the dates you expected. Check which account the CLI is linked to with status. If you need to switch accounts, unlink the CLI and approve it again while signed into the right account.
Keep your sync token private. Revoke an unused device token in settings. If a provider's logs are incomplete, the tracker cannot reconstruct missing prompts or token usage from a screenshot.
npx claudeusage-sync status
npx claudeusage-sync unlinkSources and further reading
Related: Why your Claude Code token counts look differentAPI-equivalent cost is not your Claude subscription bill