ccexplorer
Local-first Cost Explorer for Claude Code sessions. Walks
~/.claude/projects/<project>/<session>.jsonl, aggregates token usage,
and renders an AWS-Cost-Explorer-style interactive HTML report so you
can slice your spend by tool, project, session, model, and time.
Status: alpha -- v0.0.1 ships the
cce buildstatic-HTML path. CLI query subcommands (get-cost-and-usage,get-dimension-values) and the Trusted-Advisor-style recommendations engine are next.
Why
ccusage already does cost calculation well. ccexplorer adds two things the existing tools don't:
- Tool/agent attribution. Apportions each assistant turn's cost
across its
tool_useblocks so you can see which tools the money actually went to (and how much went to non-tool conversation). - A slice-and-dice surface. Same query model as AWS Cost Explorer -- time-period x granularity x metrics x group-by x filter -- so you can answer questions like "today's voicemode tool calls, grouped by session" without writing SQL.
A recommendations engine ("Trusted Advisor for Claude Code") is the next layer on top -- top-N tool over-use, repeat-read detection, cache-write premium, etc.
Privacy
100% local. The tool never makes a network call. The report is a single HTML file with your data embedded as JSON; it loads Chart.js from a CDN but nothing else leaves your machine.
Install
# Zero-install run
uvx ccexplorer
# Or install persistently
pip install ccexplorer
Usage
# Walk ~/.claude/projects, build /tmp/cce.html, open it in your browser
cce build
# Custom output path, no browser launch
cce build --output ~/cce-report.html --no-open
# Different projects root (rarely needed)
cce build --projects-root /path/to/.claude/projects
Run with no subcommand and you get cce build with default flags --
the "just show me the pretty thing" path.
What the report shows
- Total spend, with breakdowns by tool, project, session, model, and day
- Tool vs non-tool token-cost split (often surprising -- ~50% of long sessions is non-tool conversation)
- Cache-write / cache-read / input / output split (cache writes are often the largest line item on Opus sessions)
- AWS-Cost-Explorer-style sidebar: time-range presets (1d / 7d / 30d / All), group-by dropdowns, filter chips, advanced toggles
Roadmap
-
cce get-cost-and-usage(CLI flagship, mirrorsaws ce) -
cce get-dimension-values(enumerate tools / projects / models) - AGENT dimension (extract sub-agent type from
Agenttool calls) - TAG support (sidecar
<session>.tags.jsonorcce tagcommand) - COST_CATEGORY rules engine
-
cce serve(live local server, no rebuild on every change) -
cce advise-- recommendations engine
Acknowledgements
Idea and voice-spec: Mike Bailey (@mbailey) -- including the $46k of his own session data we validated against. Research, prototype, write-up: Cora 7. A "How this got built" page is forthcoming -- this project is transparent about its AI-pair-programming origin.
License
MIT.
Metadata
Release files for ccexplorer 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ccexplorer-0.0.2.tar.gz | 44.7 kB | Without provenance | Details for ccexplorer-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ccexplorer-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for ccexplorer-0.0.2-py3-none-any.whl |
Total release size: 61.0 kB
Release files / ccexplorer-0.0.2.tar.gz
| Download URL | ccexplorer-0.0.2.tar.gz |
|---|---|
| Size | 44.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4acfdd01f975b500a343a3b48ce04c9c5cf2e8c216ba915b2f3126912077059c
|
|
BLAKE2b-256 checksum How to use checksums |
6b380a108d2cf53ff48e1a5f40b0abd528683d466c15e0d1ca8409618853bca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / ccexplorer-0.0.2-py3-none-any.whl
| Download URL | ccexplorer-0.0.2-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
434d7fd024dcd0c5a8b991a90ee3bd96075735fbe9568d6777a303ae875c7757
|
|
BLAKE2b-256 checksum How to use checksums |
8951cc092dc8a43cc31141af75d391b5b3255976911eb890e740a198ba6e463e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for ccexplorer 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.