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
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:
- Open an issue first for anything beyond small fixes
- Run
uv run pytest -vbefore submitting a PR - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_code_cost_explorer-0.1.2.tar.gz.
File metadata
- Download URL: claude_code_cost_explorer-0.1.2.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
317c0c78e0beb1420d6051ee45d42cb96292607bd4fb63b86277f58ad4cc3fa1
|
|
| MD5 |
94f3bd971656f7a82ec1545a52ac8826
|
|
| BLAKE2b-256 |
d094ee51ab95e84d9a57a01631b22229df977207843db48bba362f706d8aed86
|
File details
Details for the file claude_code_cost_explorer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: claude_code_cost_explorer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75403c80658d7220942a77fe9e4ed52d0b69d5fd0a421586702f0b3450f4516d
|
|
| MD5 |
b43c4644b432365b7c84014e92167171
|
|
| BLAKE2b-256 |
22bddff231a09d51c0e8893129c740ad2200fc01ef030f08fe107a72ef6d41ba
|