Skip to main content

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 SVG 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-stats Generate a standalone dashboard HTML file and open it in the default browser.
  • codex-stats --output codex-stats-dashboard.html Write the dashboard HTML to a fixed path.
  • codex-stats --output codex-stats-dashboard.html --no-open Write the dashboard HTML without opening the browser.
  • codex-stats export codex-stats-export.json Export normalized local stats to JSON.
  • codex-stats export codex-stats-export.json --since 30d Export only a rolling window of recent sessions.

Inside the dashboard, use the action bar to:

  • switch between Day, Week, Month, and All Time
  • print the active tab to PDF
  • download shareable SVG 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.sqlite for 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 Nd limits snapshots to a rolling window before sharing.

Roadmap

The current priority list lives in docs/roadmap.md.

Shareable Assets

Share-ready assets now live under docs/assets/codex-stats-share-card.svg, and the dashboard can generate a fresh SVG download set directly from your local usage data.

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


Download files

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

Source Distribution

codex_stats-1.5.0.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

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

codex_stats-1.5.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file codex_stats-1.5.0.tar.gz.

File metadata

  • Download URL: codex_stats-1.5.0.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codex_stats-1.5.0.tar.gz
Algorithm Hash digest
SHA256 c98807fa2548ad49c34a202d636b39ea1897eb2db20b11a42c501c698eaade8a
MD5 d0d6c0513f1c88869e10a033bc909c3c
BLAKE2b-256 ab24dc6d505cb0c010b58f5c8ad5cf6cbbe5af3b0dc8d0a4af368088a9928a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_stats-1.5.0.tar.gz:

Publisher: publish.yml on vivek378521/codex-stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codex_stats-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: codex_stats-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codex_stats-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9a87fb1b86c889784d18891c4420ddb594ed63b6d3e8802c90c36693602ac8
MD5 c8ac6466d9fde1d1997a13b030a73d23
BLAKE2b-256 6df8ef3b66546be363e7633515cfce73cea47c642ee116622c8ad331eaaf0b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_stats-1.5.0-py3-none-any.whl:

Publisher: publish.yml on vivek378521/codex-stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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