Free · Open source · Runs locally

See every prompt, token and dollar of your Claude Code usage.

CCUsageX is a Claude Code usage dashboard that reads Claude Code's own logs on your machine. Track token usage and API-equivalent cost per prompt, see what prompt caching saved you, and keep your history, with nothing leaving your computer.

Run it now (Node.js 18+)

npx github:MHJoy99/CCUsageX

Or clone and start

git clone https://github.com/MHJoy99/CCUsageX.git && cd CCUsageX && node server.js
  • MIT licensed
  • Zero dependencies
  • Binds to 127.0.0.1 only
  • Windows, macOS, Linux
CCUsageX dashboard overview: cost, tokens, cache hit rate and top prompts for Claude Code

Your Claude Code numbers, at a glance

Sample 30-day summary: 1,284 requests, 96 prompts, 14 sessions, 182.4M tokens, $87.42 API-equivalent cost, 96.1% cache hit rate

Fictional demo data.

Features

A Claude Code cost tracker that goes down to the prompt

Most tools stop at daily totals. CCUsageX ties tokens, cost, time and tools back to the exact prompt that caused them.

Animated bar chart of Claude Code API-equivalent cost per model and per prompt

Cost per prompt, model and project

API-equivalent cost for every prompt and request, split by model and project. See which prompts were expensive and why, using prices you can edit.

Animated breakdown of Claude Code tokens: input, output, cache write, cache read and thinking, with cache hit rate

Token usage and cache savings

Input, output, cache write, cache read and thinking tokens, plus your cache hit rate and the dollars prompt caching saved.

Animated response time chart and tokens per second for each Claude model

Response time and speed

Typical and slowest-5% response times, and tokens per second for every model you use, so you can tell when something is slow.

Animated list of Claude Code prompts with their cost, tools used and subagent activity

Prompt text, tools and subagents

Search your prompts, open any one to see its text, tools, requests and subagent work, and export everything to CSV.

Subagent attribution

Subagent work is charged to the prompt that spawned it, so one prompt shows its true total.

Persistent history

A local copy of your usage survives Claude Code's automatic transcript cleanup.

Live and light

Rescans every few seconds, incremental, no database and no build step.

Animated example of the Plan limits card: 5-hour session and weekly gauges with reset countdowns

Plan limits

See your Claude Pro or Max 5-hour session and 7-day weekly limits, with reset times and a pace projection, plus per-model weekly limits when Claude Code reports them. CCUsageX reads Claude Code's own /usage report and refreshes it automatically every 2 minutes while the dashboard is open. It uses no login, no model tokens and no credentials. The optional status line gives instant updates in terminal sessions.

Screenshots

A Claude Code usage dashboard in light and dark

Screenshots use fictional data. The live demo lets you click around.

CCUsageX dashboard with cost, token usage by type, model breakdown and top prompts
The dashboard: cost, tokens by type, models, tools and top prompts for the last 30 days.
Prompt detail drawer showing the prompt text, cost, tokens, tools and subagent requests
Open any prompt to see its text, requests, tools and subagents.

How it works

Your logs in, a dashboard out

  1. ReadClaude Code already logs every request to ~/.claude/projects/**/*.jsonl. CCUsageX reads them read-only.
  2. Price and groupTokens are priced with editable API list prices and grouped by prompt, session, model and project. Subagents join the prompt that started them.
  3. KeepA local copy in ~/.ccusagex/store.json keeps your history after Claude Code cleans up.
  4. ServeA tiny Node server on 127.0.0.1:3020 serves the dashboard and a small JSON API.
Architecture diagram: Claude Code JSONL logs are read by the CCUsageX scanner, priced, stored locally and served to the browser dashboard on 127.0.0.1
Terminal showing git clone and node server.js starting the dashboard on http://127.0.0.1:3020

Quick start

One command, no install, no account

With Node.js 18 or newer, run npx github:MHJoy99/CCUsageX and open http://127.0.0.1:3020. Prefer a checkout? Clone the repo and run node server.js. Prices live in config.json; port and data folder are one flag or variable away.

Read the install guide

Privacy

Your prompts never leave your machine

Prompts are sensitive. CCUsageX is built so you do not have to trust a service, only a small piece of code you can read.

  • Local onlyThe server binds to 127.0.0.1, so only your own computer can open it.
  • Read-onlyClaude Code's logs are opened for reading and never modified.
  • No telemetryNo analytics, no accounts, no outbound requests, no third-party scripts.
  • Zero dependenciesPlain Node.js with its standard library. Nothing to audit but the repo.

Comparison

CCUsageX vs ccusage, Claude-Code-Usage-Monitor and Sniffly

Each of these is good at something different. Here is where CCUsageX fits, and where another tool is the better pick.

Based on each project's public README in October 2026. Tools change; check the projects for current features. Sniffly's last update was in 2025.
 CCUsageXccusageClaude-Code-Usage-MonitorSniffly
Best atPrompt-level cost, prompt text and history in a web UIFast CLI cost reports (daily, monthly, session, 5-hour blocks)Live terminal monitor of session limits and burn rateLocal web dashboard of usage stats and message history
InterfaceLocal web dashboardCommand lineTerminal UILocal web dashboard
Setupnpx or clone, Node 18+, zero dependenciesnpx / bunx or global installPython packagePython package
Cost per promptYes · API-equivalentReports by day, month, sessionNot its focusNot its focus
Prompt text, searchableYesNoNoYes · message history
Cache savings in dollars and hit rateYesShows cache tokens and costShows cache tokensShows cache tokens
Subagent attribution to the promptYes · rolled into the parent promptNot its focusNot its focusNot its focus
History after Claude Code cleans up logsYes · own local storeReads live logsReads live logsReads live logs
Plan limits and burn-rate forecastYes · Pro and Max, from the /usage report5-hour block reportsYes · its main jobNo
Works with other AI coding toolsClaude Code onlyYes · multi-toolClaude Code onlyClaude Code only

Want a fast CLI or multi-tool reports? Use ccusage. Watching your plan limits live? Use Claude-Code-Usage-Monitor. Want to know which prompt cost what, and keep that history? That is CCUsageX.

FAQ

Claude Code usage and cost: common questions

How do I see my Claude Code token usage?

Claude Code writes every request, with its token counts, to local transcript files. CCUsageX reads those files and shows input, output, cache write, cache read and thinking tokens per prompt, request, model, project and session.

Run npx github:MHJoy99/CCUsageX (Node.js 18+) and open http://127.0.0.1:3020. You can also try the live demo with fictional data first.

How much does my Claude Code usage cost?

CCUsageX multiplies the tokens in each request by Anthropic's API list prices and shows an API-equivalent cost per prompt, model, project and day.

If you use Claude Code through a Pro or Max subscription you are not billed per token. The figure is what the same usage would cost on the API, which is a useful measure of how heavy your usage is.

Where does Claude Code store its logs?

Claude Code saves each session as a JSONL transcript in ~/.claude/projects/<project>/<session-id>.jsonl (on Windows, C:\Users\<you>\.claude\projects). Subagent runs are stored in subagents sub-folders.

If you set CLAUDE_CONFIG_DIR, the folder moves there and CCUsageX follows it. Claude Code deletes old transcripts after a retention period, 30 days by default.

Does CCUsageX send my data anywhere?

No. The server listens on 127.0.0.1 only, has no telemetry or analytics, no dependencies and no outbound requests. It opens Claude Code's logs read-only and keeps its own copy in ~/.ccusagex/store.json on your machine.

The live demo on this site runs entirely in your browser with fictional numbers.

How is CCUsageX different from ccusage?

ccusage is an excellent command-line tool that prints daily, monthly, session and 5-hour-block cost reports, and it supports more tools than Claude Code. CCUsageX is a local web dashboard focused on the prompt level: what each prompt cost, the prompt text, cache savings, subagent attribution, and a history that outlives Claude Code's log cleanup.

They answer different questions and work well side by side.

Why are subagent output tokens under-counted?

For some streamed requests, mostly from subagents, Claude Code logs only the usage snapshot taken when the stream started, when output_tokens is still a small placeholder, instead of the final total.

CCUsageX keeps the highest value it sees and flags those requests as incomplete, so output and thinking tokens (and their cost) can be lower than the real figure. Input and cache counts are reported at stream start and are not affected.

Does CCUsageX work with a Claude Pro or Max subscription?

Yes. Claude Code writes the same logs on every plan, so the dashboard works the same way. The cost shown is API-equivalent, not your bill.

CCUsageX reads your plan limits only from Claude Code's /usage report, described in "Can CCUsageX show my Claude plan usage limits?" below. Otherwise it is a usage and cost analyzer, not a limit monitor.

Can CCUsageX show my Claude plan usage limits?

Yes, for Claude Pro and Max subscriptions. CCUsageX reads Claude Code's documented /usage report, which shows your 5-hour session and 7-day weekly limits with their reset times, plus per-model weekly limits when Claude Code reports them. The dashboard refreshes it automatically every 2 minutes while it is open, and a refresh button runs it on demand. It uses no model tokens, writes no transcript, needs no login, makes no direct API calls and never reads credentials. An optional status line (npm run statusline:install) gives instant updates in terminal sessions; npm run statusline:uninstall reverses it.

Can I change the prices?

Yes. Edit pricing.models in config.json: input, output and cacheRead prices in USD per million tokens, plus cache-write multipliers (1.25 for the 5-minute cache, 2 for the 1-hour cache) and optional fast-mode and long-context tiers. Restart the server to apply changes.

The defaults follow Anthropic's published API list prices, last checked 2026-10-06.

How do I install and run CCUsageX?

You need Node.js 18 or newer. Run npx github:MHJoy99/CCUsageX, or clone the repository and start it with node server.js. The dashboard opens on port 3020; change it with --port or the PORT environment variable.

On Windows there are also double-click launcher scripts, Open-CCUsageX.cmd and Close-CCUsageX.cmd.

Does it keep my history after Claude Code deletes old logs?

Yes. CCUsageX scans the transcripts incrementally every few seconds and stores its own copy in ~/.ccusagex/store.json (override with CCU_DATA_DIR). Totals stay intact after Claude Code cleans up its transcripts.

History starts from whatever transcripts exist when you first run it, so the sooner you start it, the more you keep.

What do cache read, cache write and "cache saved" mean?

Prompt caching lets Claude Code re-use context it already sent. Cache write tokens store that context, and cache read tokens re-use it at a fraction of the normal input price.

"Cache saved" is what the cache-read tokens would have cost at the full input price minus what they cost at the cache-read price. The cache hit rate is the share of input served from cache.

Find out where your Claude Code tokens go

Open the live demo in your browser, or run CCUsageX on your own logs in one command.