Local AI usage observability CLI for Codex sessions.
Project description
codex-stats
codex-stats is a local analytics CLI for Codex usage.
It reads your local Codex state from ~/.codex and surfaces:
- session summaries
- rolling usage totals across today, week, month, or the last
Ndays - model and project breakdowns
- recent session history
- estimated token-based cost
- basic usage insights
- export and import for cross-device snapshots
Install
pipx install codex-stats
Or with pip:
python3 -m pip install codex-stats
Commands
codex-stats
codex-stats today
codex-stats week
codex-stats month
codex-stats session
codex-stats session --id <session_id>
codex-stats models
codex-stats project
codex-stats history
codex-stats costs
codex-stats insights
codex-stats --days 14
codex-stats --color always
codex-stats export codex-stats-export.json
codex-stats import codex-stats-export.json
codex-stats --json
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.
exportandimportlet you move normalized snapshots between machines.--color auto|always|nevercontrols ANSI styling.
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-0.3.0.tar.gz.
File metadata
- Download URL: codex_stats-0.3.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
860595655b4805758792b0d913e1b578ad34eaa0b67cf2d74c1573e9fc5167b9
|
|
| MD5 |
779aadd1c23b4fff564e6f23e5cee8da
|
|
| BLAKE2b-256 |
a11af19483972842f06501ac7093d80725f62ca13ca0a3f40dbc698f8aaa1dce
|
Provenance
The following attestation bundles were made for codex_stats-0.3.0.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-0.3.0.tar.gz -
Subject digest:
860595655b4805758792b0d913e1b578ad34eaa0b67cf2d74c1573e9fc5167b9 - Sigstore transparency entry: 1226676853
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@cbdf062671b5d7e56bb234db13dd3adf045b7caf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbdf062671b5d7e56bb234db13dd3adf045b7caf -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_stats-0.3.0-py3-none-any.whl.
File metadata
- Download URL: codex_stats-0.3.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
581d6d42e7bae9ce7efa38ae45805c8f9ae0c16e5e36e6b832ef1c6b9e0895c1
|
|
| MD5 |
4994a40cfa2548585bd131654b708b19
|
|
| BLAKE2b-256 |
ceabcee0b9216f039884414adff9a49184383f23eaea99a22acd47d0363b850e
|
Provenance
The following attestation bundles were made for codex_stats-0.3.0-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-0.3.0-py3-none-any.whl -
Subject digest:
581d6d42e7bae9ce7efa38ae45805c8f9ae0c16e5e36e6b832ef1c6b9e0895c1 - Sigstore transparency entry: 1226676887
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@cbdf062671b5d7e56bb234db13dd3adf045b7caf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbdf062671b5d7e56bb234db13dd3adf045b7caf -
Trigger Event:
release
-
Statement type: