Skip to main content

Local web app to explore Claude Code API cost and token usage by day, session, and turn

Project description

Claude Code Cost Explorer

A local web app to explore Claude Code usage — cost and token breakdown by day, session, and message turn.

No data leaves your machine. No API key needed. Reads directly from ~/.claude/.


Screenshot

App preview

Drill down: Day → Session → Turn

  • 💬 Conversation turns → full messages + collapsible thinking
  • 🛠️ Tool calls → [tool: Bash], [3 tools: Read, Write, Glob] → inputs + raw output

Install

pip install claude-code-cost-explorer

Run

ccx

Open: http://localhost:5050

Requirements

Claude Code installed and used at least once (~/.claude/projects/ exists)

How it works

Reads token usage from: ~/.claude/projects/**/*.jsonl

Uses Claude pricing to compute cost.


Tips: Session naming

Session titles come from whatever name Claude Code assigned the session. Three ways to set one:

How When
claude -n "my-feature" At startup — best option
/rename my-feature During a conversation
Press R in the /resume picker After the fact

If you don't name a session, Claude assigns a random slug (e.g. jolly-spinning-mango). A deliberate name like payments-refactor makes the session list much easier to scan when comparing costs across similar work.


Contributing

Bug reports and PRs are welcome! Please:

  1. Open an issue first for anything beyond small fixes
  2. Run uv run pytest -v before submitting a PR
  3. Keep the zero-dependency philosophy — no npm, no build step, no database

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_cost_explorer-0.1.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_code_cost_explorer-0.1.2-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file claude_code_cost_explorer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for claude_code_cost_explorer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 317c0c78e0beb1420d6051ee45d42cb96292607bd4fb63b86277f58ad4cc3fa1
MD5 94f3bd971656f7a82ec1545a52ac8826
BLAKE2b-256 d094ee51ab95e84d9a57a01631b22229df977207843db48bba362f706d8aed86

See more details on using hashes here.

File details

Details for the file claude_code_cost_explorer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_cost_explorer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75403c80658d7220942a77fe9e4ed52d0b69d5fd0a421586702f0b3450f4516d
MD5 b43c4644b432365b7c84014e92167171
BLAKE2b-256 22bddff231a09d51c0e8893129c740ad2200fc01ef030f08fe107a72ef6d41ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page