Agent Hours
Agent Hours is a local CLI that measures Codex and Claude Code agent-hours. It also reports local token counts and measured runtime for Antigravity and Muse Code.
See your runtime across profiles and machines, calculate optional Agent Leverage, and make a share card at agenthours.dev.
uvx codex-agent-hour-tracker --share
Requires uv and a local Codex session archive. The package supports Python 3.11–3.14 on macOS, Linux, and Windows. Archive-derived runtime is an estimate: missing records and sparse timestamps affect coverage.
Your Agent-Hour Score
The score is mean cumulative runtime across the 30 most recent completed local calendar days ending yesterday. Zero-use days count. Overlapping turns count independently: three agents running for one hour contribute three agent-hours.
If today is March 1 in a non-leap year, the window is January 30 through February 28. Custom date ranges produce reports, not canonical scores.
The default Codex interactive-only scope excludes exec/batch files. It includes delegated turns and non-batch turns with uncertain source metadata. Use --include-exec to count exec/batch work as well. Every score states its scope.
Install once
uv tool install codex-agent-hour-tracker
agent-hours --share
Or use pipx:
pipx install codex-agent-hour-tracker
codex-agent-hour-tracker --share
Both command names invoke the same tool. Upgrade an existing uv installation with uv tool upgrade codex-agent-hour-tracker.
Claude Code and combined reports
Codex remains the default. Select Claude Code or combine both providers:
agent-hours --provider claude
agent-hours --provider all --monthly
agent-hours --provider all --sessions-dir ~/.codex/sessions --claude-sessions-dir ~/.claude/projects
Both directory options are repeatable. Explicit Claude roots select Claude when --provider is omitted. Supplying both root options selects both providers.
Claude discovery uses $CLAUDE_CONFIG_DIR/projects, or ~/.claude/projects when the variable is unset. Combined discovery skips missing default roots. Explicit missing roots produce errors.
Claude main totals use native system / turn_duration records with durationMs, a timestamp, and an immutable UUID. Delegated totals use completed foreground-agent summaries with totalDurationMs, agent ID, completion UUID, and timestamp. The start is the recorded end minus the native duration. Async launches and histories without either timing source contribute no runtime. Child-native timers are excluded to avoid counting the same delegated run twice. Transcript gaps, prompts, and assistant timestamps never supply estimated durations. Claude main-session human initiation is unverified, so those turns do not enter human-initiated statistics. Claude native totals may include SDK or headless activity because origin cannot be verified.
Combined reports show provider subtotals and add concurrent runtime across both providers. Combined CSV appends provider hours and turn counts to the aggregate columns. Single-provider CSV retains the existing three columns.
Public --share output supports Codex, Claude Code, and combined totals. Historical published benchmarks remain Codex-only. Claude and combined scores retain the timing coverage and origin limits described above.
For four machines, run this export on each machine with a distinct label and filename:
agent-hours --provider all --export reports/machine1.agent-hours-private.json --label machine1
Privately transfer the four archives, then combine them:
agent-hours --provider all --timezone Pacific/Honolulu --monthly \
--merge reports/machine1.agent-hours-private.json \
--merge reports/machine2.agent-hours-private.json \
--merge reports/machine3.agent-hours-private.json \
--merge reports/machine4.agent-hours-private.json
Use the same imports with --provider codex or --provider claude for separate totals. Merge-only commands do not scan local defaults. Copied histories are deduplicated within each provider. Keep archives private. See export contracts.
Antigravity
Install ccusage v20.0.51 or later for local token counts, including cached tokens. Agent Hours runs it offline. The command defaults to the last 30 completed days.
npm install -g ccusage
agent-hours google-usage
agent-hours usage --provider antigravity --format csv --timezone Pacific/Honolulu
Use --ccusage EXECUTABLE if ccusage is outside your PATH. Set ANTIGRAVITY_DATA_DIR for a custom data root. Keep daily reports private.
Antigravity hours come from recorded generation and execution intervals in local conversation database metadata. Overlapping intervals count once within a conversation, and separate conversations add independently. Each interval is attributed to its start date. Missing timing is displayed as unavailable (a blank CSV cell). These hours are separate from the public Agent-Hour Score.
Muse Code and combined usage
agent-hours usage reports Antigravity and Muse Code in one private report. The google-usage alias reports Antigravity alone. Use repeatable --muse-sessions-dir PATH to specify existing Muse Code session roots, or omit it to use default Muse Code session discovery.
agent-hours usage --provider muse
agent-hours usage --provider muse --muse-sessions-dir ~/private/muse-sessions --format csv
agent-hours usage --provider all
Muse Code runs without ccusage. With --provider all, missing ccusage makes Antigravity and combined token totals unavailable. The report still shows Muse Code usage and available measured hours, and the command exits with status 1. A failed token read for any requested provider also exits with status 1.
Muse Code figures come from retained local session logs. Measured hours cover recorded model and tool execution. The report shows Muse Code tokens as unavailable when it finds no readable logs. Skipped or unsupported records produce a partial-coverage warning. Meta's session audit guide
Private ChatGPT account usage
agent-hours account-usage --label laptop
Uses your existing ChatGPT-backed Codex login to request service-reported token summaries and daily buckets. API-key-only login is unsupported. It writes private JSON and daily CSV to reports/account-usage/, ignored in this repository, with no metrics printed. Choose --output-dir for another private location. Identity is fingerprinted by default; --include-identity explicitly includes plaintext identity. These exports must never enter share cards or the public scoreboard.
This is separate from archive-derived runtime. Daily history can be sparse; timezone, retention, and lifetime completeness are unknown. See private account exports for permissions, Windows, secure capture, and null values.
Calculate Agent Leverage
Supply your human hours for the entire report period:
agent-hours --share --human-hours 160
Or estimate them from a weekly schedule:
agent-hours --share --human-hours-per-week 40
Agent Leverage divides agent runtime by human hours over the same period. A weekly estimate uses weekly hours × calendar days / 7. The output identifies the assumption. The tool does not measure your human work time or infer it from prompt timestamps.
Make a share card
agent-hours --share --format json
agent-hours --provider claude --share --format json
agent-hours --provider all --share --format json
Upload or paste this sanitized aggregate JSON into the share studio. Preview and download a square or landscape PNG/SVG in your browser. Importing a score and making a card run locally. The website accepts only the public score schema.
Codex public JSON keeps schema v1. Claude and combined JSON use schema v2 with an explicit provider. Combined public scores contain one aggregate. The scope field selects Codex source eligibility. Claude native turns retain unverified main-session origin under either scope. See export contracts.
--share is the safe default for sharing, but dates, counts, durations, timezone, and optional human-hours assumptions remain a deliberate aggregate disclosure. Review the card before posting it.
Join the community scoreboard
The separate community page shows self-reported scores. GitHub sign-in identifies the person posting, but does not verify their runtime. Scores can be edited or inflated.
Codex, Claude, and combined scores have separate boards for each session scope. Posting replaces your score for that provider and scope. Historical Codex benchmarks do not establish Claude or combined rankings.
After importing your score, choose Share to community. Review the public fields, sign in with GitHub, and confirm the post. Importing a file never posts it. The community score omits Agent Leverage and human-hours assumptions.
Each GitHub account can make five successful posts in a rolling 30-day window across all providers and session scopes. Updating a score counts as a post. Deleting it does not refund a slot. The page warns you after your fourth post and shows when a slot opens.
The local card tool works without an account or community access. Hosting and privacy details are in the community guide.
Profiles and machines
Repeat --sessions-dir to combine local profile directories:
agent-hours --sessions-dir PROFILE_A/sessions --sessions-dir PROFILE_B/sessions --share
For multiple machines, export private timing metadata on each machine:
mkdir -p reports
agent-hours --export reports/laptop.agent-hours-private.json --label laptop
Transfer those private exports using your own secure file-transfer method, then merge them:
agent-hours --merge reports/laptop.agent-hours-private.json \
--merge reports/desktop.agent-hours-private.json --share --include-exec
The merge deduplicates turn identifiers before calculating the combined total. Private exports retain all source classes so you can choose the scope when merging. They contain precise timestamps and hashed turn identifiers. Do not upload them to the website or commit them. The tracker does not read account credentials or separate accounts that share a session directory.
Daily and monthly reports
Explicit --start and --end values define an inclusive local-calendar range:
mkdir -p reports
agent-hours --start 2025-01-01 --end 2025-01-30 --monthly \
> reports/january-summary.txt
agent-hours --start 2025-01-01 --end 2025-01-30 --format csv \
> reports/january-summary.csv
Text reports include daily distribution, monthly summaries when requested, and human-initiated top-level turn count, mean, and median duration. CSV retains one row per calendar date. Partial-month averages use only the days in the requested range. Use --timezone IANA_ZONE when combining machines with different local timezones.
Full reports and CSVs reveal semi-sensitive activity patterns. Keep generated files in the ignored reports/ directory and review any output before distribution.
What the numbers can tell you
Agent-hours measure runtime, not useful output, human-equivalent labor, or time saved. Benchmarks are dated contextual references, not a personal ranking. See benchmarks and the methodology for populations, denominators, and timing rules.
The scanner retains compact timing metadata without decoding conversation, reasoning, or tool payloads. No session data leaves the machine through the CLI. Compacted records remain supported while completed-turn metadata survives.
Scans and private exports read both .jsonl and .jsonl.zst rollouts. When both forms exist beside each other, the plain file takes precedence. Compressed input streams through the same metadata parser. Invalid or truncated compressed streams produce aggregate decompression diagnostics.
Development
uv run python -m unittest discover -s tests -v
npm ci --ignore-scripts
npm test
npm run build:check
python3 scripts/sync_benchmarks.py --check
The repository has a Python package in src/agent_hour_tracker/, synthetic tests in tests/, and browser assets in site/. The optional community API uses Pages Functions in functions/, application code in community/, and D1 migrations in migrations/. Node.js 24 runs the website development tools. Installing the Python CLI does not install or run the website backend.
The export contracts define private merge data and public score data separately. The package benchmark registry generates the website copy through scripts/sync_benchmarks.py.
The optional Codex skill guides collection and sharing workflows. It is not required to install or run the tool.
Read the changelog, security policy, and MIT license.
Metadata
Release files for codex-agent-hour-tracker 0.4.0
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 |
|---|---|---|---|---|
| codex_agent_hour_tracker-0.4.0.tar.gz | 240.0 kB | With provenance | Details for codex_agent_hour_tracker-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codex_agent_hour_tracker-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for codex_agent_hour_tracker-0.4.0-py3-none-any.whl |
Total release size: 295.5 kB
Release files / codex_agent_hour_tracker-0.4.0.tar.gz
| Download URL | codex_agent_hour_tracker-0.4.0.tar.gz |
|---|---|
| Size | 240.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ae9b8293cbf4d493c83372d8d22a94e16e1225d3ed4e1172fa5fac70e59a3b7
|
|
BLAKE2b-256 checksum How to use checksums |
b3882bfbfad3c868d0f652fcb8b58db5507495eb7c71e6294337c2c414acd0b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / codex_agent_hour_tracker-0.4.0-py3-none-any.whl
| Download URL | codex_agent_hour_tracker-0.4.0-py3-none-any.whl |
|---|---|
| Size | 55.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bc8f657a30fe68d42f23ba1ba2539847fe837c19569fd23323f76ac84cb387d
|
|
BLAKE2b-256 checksum How to use checksums |
82ddd26d996e520b07afd1e4f427e2b1c738c5069f0a1d443d035b2cd4cbee2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for codex-agent-hour-tracker 0.4.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for codex_agent_hour_tracker-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA 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.