RoninForge / claude-code-cost
A Claude Code plugin. The /cost slash command shows your Claude Code spend in USD, per project and per git branch, computed locally on your machine.
Zero key. Zero prompts. Zero latency. It reads the JSONL session logs Claude Code already writes locally, and prices each response point-in-time from the open ai-price-index dataset, bundled at build time so there is no runtime network.
Then run /cost. Requires node (>= 18) on your PATH, which Claude Code users almost always have. No binary, no curl, no Homebrew.
/cost prints your Claude Code spend grouped by project and by the git branch that was checked out when each response ran, for today, the current week, and the current month.
Installs through the Claude Code plugin system. No binary to download, no curl pipe, no Homebrew. It needs only node (>= 18) on PATH, which Claude Code already relies on.
Each response is priced at the rate that was live on its own date, from the open ai-price-index dataset (CC BY 4.0) bundled at build time. A later price change never rewrites your past spend.
Reads ~/.claude/projects/**/*.jsonl on disk. No API keys. No prompts sent anywhere. No telemetry. The pricing data is embedded, so nothing leaves the machine.
Input, output, cache-read, and cache-write tokens are all priced. Claude Code repeats the same response across several JSONL lines, so the plugin dedups those before counting.
On API billing the dollars are your real cost. On flat-rate Pro and Max subscriptions, token usage is still tracked and priced as a metric so you can see which work burns the most of your plan.
/plugin marketplace add RoninForge/claude-code-cost./plugin install claude-code-cost@roninforge. Requires node (>= 18)./cost for the full table./cost <filter> narrows to a project or branch, /cost --self forces the built-in reader, and /cost --json prints machine-readable output.> /cost PROJECT BRANCH TODAY WEEK MONTH myapp main $4.85 $28.30 $112.40 myapp feature/auth $1.20 $3.20 $3.20 side-proj main $0.00 $0.50 $14.10 TOTAL $6.05 $32.00 $129.70
~/.claude/projects/**/*.jsonl, the session logs Claude Code already writes to disk.claude-code-cost never asks for an Anthropic key and cannot log in to your account. It only reads files you already own.
Only token counts, model, project, branch, and date are read. Prompt and response text are ignored, and nothing leaves the machine.
Not an API proxy. Not a process injector. Claude Code's traffic is completely untouched. Tooling is MIT and the bundled pricing data is CC BY 4.0.
Zero key, zero prompts, zero latency. The trust pledge is load-bearing: claude-code-cost parses what Claude Code already writes to local disk and nothing else.
claude-code-cost is fully self-contained. But if BudgetClaw is also installed, /cost uses it automatically for a richer view backed by a persistent database and budget caps. If BudgetClaw is not present, the built-in reader is used. Run /cost --self to force the built-in reader either way.
Want spend across providers and machines in one place? Goei at goei.roninforge.org unifies billing into one view. claude-code-cost stays a local, read-only plugin; the dashboard is an opt-in next step, not a requirement.
It reads the JSONL session log files Claude Code already writes to ~/.claude/projects/ on your machine, counts the billable assistant responses, and prices each response point-in-time from the bundled open ai-price-index dataset, at the rate that was in effect on that response's own date. Input, output, cache-read, and cache-write tokens are all counted. Claude Code writes the same response across several JSONL lines, so the plugin dedups those repeated lines before pricing. Nothing leaves the machine.
No. claude-code-cost is self-contained and ships its own built-in JSONL reader and pricing data. If BudgetClaw happens to be installed, /cost uses it automatically for a richer view backed by BudgetClaw's persistent database. If it is not installed, the built-in reader is used. Run /cost --self to force the built-in reader even when BudgetClaw is present.
No. claude-code-cost reads local log files. It never sits between your editor and the Anthropic API, never asks for a key, never sees a prompt or response body, and adds no latency. Zero key, zero prompts, zero latency.
Inside Claude Code, run /plugin marketplace add RoninForge/claude-code-cost, then /plugin install claude-code-cost@roninforge. After that, run /cost. It requires node (>= 18) on your PATH, which Claude Code users almost always have. There is no binary to download, no curl pipe, and no Homebrew step.
Yes. It reads the same local JSONL logs regardless of how you are billed. On API usage the dollar figures are your real cost. On flat-rate Pro and Max subscriptions, token consumption is still tracked and priced as a usage metric, so you can see which projects and branches burn the most of your plan.
Only the local JSONL session logs under ~/.claude/projects/. From each line it uses the token counts, model id, working directory, git branch, and timestamp. Prompt and response text are ignored. Nothing is uploaded and nothing leaves your machine.
Unknown models are surfaced in the output rather than silently dropped, so a new Anthropic model never makes your spend look artificially low. The bundled ai-price-index dataset is updated as new models and rates land, and each release embeds a fresh copy.
claude-code-cost is one of several tools from RoninForge. See also BudgetClaw for hard spend caps, and Goei for a cross-provider billing dashboard.