Local AI usage observability CLI for Codex sessions.
Project description
codex-stats
codex-stats is a local analytics tool for Codex usage.
It reads your local Codex state from ~/.codex and surfaces:
- a browser dashboard with day, week, month, and all-time tabs
- model and project breakdowns
- recent session history
- estimated token-based cost
- anomaly-aware usage insights and recommendations
- export for cross-device snapshots
- shareable JPG cards and browser PDF export from the dashboard
Install
pipx install codex-stats
Or with pip:
python3 -m pip install codex-stats
Command Reference
codex-statsGenerate a standalone dashboard HTML file and open it in the default browser.codex-stats --output codex-stats-dashboard.htmlWrite the dashboard HTML to a fixed path.codex-stats --output codex-stats-dashboard.html --no-openWrite the dashboard HTML without opening the browser.codex-stats export codex-stats-export.jsonExport normalized local stats to JSON.codex-stats export codex-stats-export.json --since 30dExport only a rolling window of recent sessions.
Inside the dashboard, use the action bar to:
- switch between
Day,Week,Month, andAll Time - print the active tab to PDF
- download shareable JPG cards for summary, cost, focus, and project share
How It Works
codex-stats does not proxy or intercept Codex API traffic.
It reads local Codex artifacts, including:
state_5.sqlitefor session metadata- rollout JSONL files for request and token snapshots
Notes
- Costs are estimates, not billing values.
- Output depends on local Codex file formats remaining compatible.
export --since Ndlimits snapshots to a rolling window before sharing.
Roadmap
The current priority list lives in docs/roadmap.md.
Shareable Assets
The dashboard exports JPG cards with names like:
- docs/assets/codex-stats-week-summary-card.jpg
- docs/assets/codex-stats-week-cost-card.jpg
- docs/assets/codex-stats-week-focus-card.jpg
- docs/assets/codex-stats-week-projects-card.jpg
These sample assets were generated from the current renderer so the docs match what the dashboard actually downloads.
Development
For local development from the repo:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools
python -m pip install -e .
Run without installing:
PYTHONPATH=src python3 -m codex_stats
Project details
Release history Release notifications | RSS feed
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 codex_stats-1.5.5.tar.gz.
File metadata
- Download URL: codex_stats-1.5.5.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f698ecd413ef55605622888e4b84f3e7ede2afbc0e911d4e0973e0bc92ad0ff6
|
|
| MD5 |
17ff67b798ad5f0be935a6eb36da9203
|
|
| BLAKE2b-256 |
45255ee02703970e9763f0ee7f9b4006f466df8ab11cc06756ed002f312d48e7
|
Provenance
The following attestation bundles were made for codex_stats-1.5.5.tar.gz:
Publisher:
publish.yml on vivek378521/codex-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_stats-1.5.5.tar.gz -
Subject digest:
f698ecd413ef55605622888e4b84f3e7ede2afbc0e911d4e0973e0bc92ad0ff6 - Sigstore transparency entry: 1337792839
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@102b36699c3c5fe46a14ce617abf6d0ac1fca32d -
Branch / Tag:
refs/tags/v1.5.5 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@102b36699c3c5fe46a14ce617abf6d0ac1fca32d -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_stats-1.5.5-py3-none-any.whl.
File metadata
- Download URL: codex_stats-1.5.5-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a72a09d2b43dd04e9ca374d23261f48f5a500b210fd700e9af44af83c0a28b03
|
|
| MD5 |
8888559a10c6cae061bdf6a0b34fe10b
|
|
| BLAKE2b-256 |
946d3683c7d67ad05aa4ad383ae76dd2e4af6c140cc2481fe4cdd2cd786817c6
|
Provenance
The following attestation bundles were made for codex_stats-1.5.5-py3-none-any.whl:
Publisher:
publish.yml on vivek378521/codex-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_stats-1.5.5-py3-none-any.whl -
Subject digest:
a72a09d2b43dd04e9ca374d23261f48f5a500b210fd700e9af44af83c0a28b03 - Sigstore transparency entry: 1337793046
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@102b36699c3c5fe46a14ce617abf6d0ac1fca32d -
Branch / Tag:
refs/tags/v1.5.5 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@102b36699c3c5fe46a14ce617abf6d0ac1fca32d -
Trigger Event:
release
-
Statement type: