ClaudeMap

ccusage

Token usage and cost analytics for Claude Code, straight from your local logs.

SDKs & Toolinganalyticscostusagecli

ccusage is the standard analytics tool for Claude Code spending: it parses your local Claude Code JSONL logs and reports daily/monthly/aggregate token usage and estimated costs per model, per session, and per 5-hour billing block. Fully offline — no API calls, no data leaves your machine. Run with npx ccusage@latest.

What it does

  • daily / monthly / session / blocks reports: tokens and estimated cost per model
  • Blocks mode maps usage onto Claude subscription 5-hour billing windows
  • Reads local JSONL logs (~/.claude) — fully offline, nothing leaves the machine
  • Live monitoring mode plus statusline integration for in-terminal budgets

When to use it

Answering how much your Claude Code usage actually costs, or which session ate the tokens, without wiring up a dashboard. An essential companion for Max-subscription users and API-key teams alike.

Getting started

npx ccusage@latest              # daily report
npx ccusage@latest monthly      # monthly view
npx ccusage@latest blocks --live # 5-hour billing windows, live

Things to know

Costs are estimates computed from token counts and public API prices — subscription usage isn't billed per token, so treat dollar figures as directional. Numbers are only as complete as your local logs.

Repository

ccusage/ccusage

Charted

Related on the map

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup