# Why your Claude Code token counts look different Canonical: https://www.claudeusage.com/guides/claude-code-token-counts Updated: 2026-09-27 Raw tokens, cache reads, and weighted tokens answer different questions. Here is how to compare them without confusing usage with a bill. ## Start with the same unit A raw token count adds input, output, cache creation, and cache reads. A long conversation can reuse a large amount of cached context on each request. That repeated context is part of the raw total, even though you did not type it again. claudeusage also shows weighted tokens, previously labeled billed tokens. This is a comparison metric: input + output + 1.25 × cache creation + 0.10 × cache reads. It is not a token allowance from your subscription and it cannot be multiplied by a single rate to produce your invoice. ## A worked example Suppose your logs contain 10,000 input tokens, 2,000 output tokens, 8,000 cache-creation tokens, and 100,000 cache-read tokens. The raw total is 120,000. The weighted total is 32,000: 10,000 + 2,000 + 10,000 + 10,000. Both totals can be correct. They measure different things. Output tokens still have their own model-specific price when we estimate dollar cost, even though the weighted comparison metric gives them a weight of one. ## Read the model percentages The model breakdown shows each model's share of all-time weighted tokens. Changing the timeline to a day or month does not change that lifetime breakdown. Its All time label is intentional. The token-composition panel is also all-time, and uses raw tokens. Small positive shares retain a decimal place. A share smaller than 0.1% is shown as <0.1%, so a model with usage does not appear to have none. Rounded percentages can add to slightly more or less than 100%. ## Check the same dates and machines Compare the same calendar dates, models, and local log files in each tool. A second machine has its own logs. Old files may have rotated away before the first upload. Uploaded totals remain in claudeusage, while a local report can only inspect files still on disk. Use the doctor command to inspect local coverage and the last sync marker. Preview a sync before uploading it. The preview contains numeric aggregates and model identifiers, not your prompts or source code. ```sh npx claudeusage-sync doctor npx claudeusage-sync --dry-run ``` ## Known limits of the estimate The weighted metric uses fixed cache multipliers for comparability. It does not reproduce every provider's cache duration, long-context pricing, discounts, or billing rules. API cost is estimated separately from stored pricing snapshots, with a same-family fallback when an exact Claude model price is missing. An unpriced model contributes tokens and messages but no estimated dollars. Unpriced does not mean free. For an actual charge, consult the provider's billing record. Sources: - Anthropic: prompt caching and usage fields: https://platform.claude.com/docs/en/build-with-claude/prompt-caching - The open-source claudeusage parser: https://github.com/bazarkua/claudeusage-sync/tree/main/src/parse --- # API-equivalent cost is not your Claude subscription bill Canonical: https://www.claudeusage.com/guides/claude-code-cost-vs-subscription Updated: 2026-09-27 A profile can show thousands of dollars in estimated usage without you owing that amount. Here is what the cost number actually means. ## What the dollar number measures claudeusage estimates what the uploaded token usage would cost at the API rates in its stored pricing snapshots. Each token category is priced separately for its model. Input, output, cache writes, and cache reads do not necessarily have the same rate. That estimate helps compare usage over time. It does not read your Anthropic payment history, subscription invoice, account credits, or negotiated rates. It is not a receipt. ## Subscription usage and API billing are different If you use Claude Code through a subscription, the subscription's price and usage limits govern that access. A large API-equivalent estimate does not by itself create an extra charge. Separate API-key usage or other paid usage settings can have different billing rules, so check the account you actually used. Anthropic's own usage and billing tools are the source for remaining allowances and actual charges. The claudeusage profile answers a narrower question: how much usage is represented in the logs you uploaded? ## Why a new model may use an estimated rate Pricing snapshots are refreshed separately from the CLI. If a snapshot has an exact model entry, that entry is used. Otherwise the resolver can use a related model identifier or a Claude-family fallback. That prevents a new Claude model from silently appearing to cost nothing, but it also means the result is an estimate. Models without a usable price show Unpriced in the model breakdown. Their token counts remain visible. Summed dollar totals therefore cover priced usage only and can understate the total API-equivalent value of a mixed-model history. ## Compare costs fairly Use the same date range and model mix. Cache-heavy work can have a much larger raw token total without a proportional dollar increase. A profile rank reflects uploaded estimated usage, not software quality, working hours, or money saved. If you are checking a discrepancy, record the date range, model, raw token categories, and pricing assumptions. Those details are more useful than comparing two rounded headline numbers. Sources: - Anthropic: models, usage, and limits in Claude Code: https://support.claude.com/en/articles/14552983-models-usage-and-limits-in-claude-code - Anthropic API pricing: https://platform.claude.com/docs/en/about-claude/pricing --- # Track Claude Code usage across your machines Canonical: https://www.claudeusage.com/guides/track-claude-code-usage Updated: 2026-09-27 Install nothing globally. Preview your local usage, approve a device, and keep one profile for the machines you work on. ## 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. ```sh npx claudeusage-sync doctor ``` ## Preview 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. ```sh npx claudeusage-sync --dry-run ``` ## Approve 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. ```sh npx claudeusage-sync ``` ## Add 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. ```sh npx claudeusage-sync status npx claudeusage-sync unlink ``` Sources: - claudeusage-sync source and command reference: https://github.com/bazarkua/claudeusage-sync - claudeusage-sync on npm: https://www.npmjs.com/package/claudeusage-sync --- # What a Claude Code usage tracker uploads Canonical: https://www.claudeusage.com/guides/claude-code-usage-privacy Updated: 2026-09-27 The boundary between local session files, private sync metadata, and the numbers visible on a public profile. ## Local files contain more than the upload Claude Code session files can contain conversation content. The sync CLI reads usage fields from those records and creates date-and-model aggregates. Reading a file locally is different from uploading the whole file. The upload includes numeric token counts, message and session counts, estimated active time, model names, and sync metadata. It does not include prompts, responses, source code, or project names as separate fields. CLI version 0.4.2 adds sanitization for path-shaped model identifiers before upload. The website also replaces them with local-model in public views. ## Private sync metadata The server needs a machine identifier, a sync window, and credentials to associate an upload with your account and avoid replaying an accepted batch. This metadata is private. It is not part of the public leaderboard. A browser sign-in session and a CLI sync token are separate credentials. Signing out of the website does not unlink the CLI. Revoke a token in settings when it should stop uploading. ## Public profile information Your chosen username, public display name, optional country, and public usage totals can appear on the leaderboard. A linked profile can show aggregate analytics to viewers with access. Optional social links are public by design. If you prefer not to publish your name, choose the anonymous identity option. Anonymity does not make the usage totals private. Avoid a display name or social link that identifies you if that matters to you. ## Inspect before trusting Read the parser and payload builder in the public CLI repository. Run a dry run and inspect the fields. Compare those fields with the privacy page rather than relying on a badge or a slogan. Website traffic analytics are separate from uploaded Claude usage. Public visitor statistics are aggregate measurements with a named source and date range. They do not expose individual browsing histories or identify which visitor belongs to a Claude profile. ```sh npx claudeusage-sync --dry-run ``` Sources: - Inspect the payload builder: https://github.com/bazarkua/claudeusage-sync/blob/main/src/aggregate/payload.ts