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

  • E2B

    SDK / Tool

    Open-source secure sandboxes where AI agents run code — the de facto execution layer for agent apps.

    • sandbox
    • code-execution
    • sdk
    • agents
  • FastMCP

    SDK / Tool

    Pythonic framework for building MCP servers — decorators, type hints, and zero boilerplate.

    • framework
    • python
    • mcp
    • type-driven
  • Anthropic's official TypeScript SDK for building agentic applications.

    • official
    • sdk
    • typescript
    • anthropic