ai-agents-metrics
Analyze your AI agent work history. Track spending. Optimize your workflow.
AI is writing more of your code. You still don't know:
- How many attempts each task actually takes
- Where the process breaks down and why
- Whether your workflow is getting faster or generating more rework
ai-agents-metrics extracts these signals from your existing Claude Code or Codex history — no manual setup required. Point it at your history files and see what's happening: retry pressure, token cost, session timeline. For richer tracking, add explicit goal boundaries and outcome labels on top.
Running this on 6 months of Claude Code + Codex history (3.85B tokens, 160 threads) surfaced:
- 100% of Claude "retries" are subagent spawns, not user retries —
attempt_count > 1is structural, not a failure signal (F-001)- Subagent delegation halves main-session tokens within-thread — median 2.05× compression, p = 0.000456 (F-007)
- Per-skill compression ranking —
Explore2.63×,code-reviewer3.25×,commit0.72× (F-008)Full index: docs/findings/. N=1 developer; the mechanisms generalize because they come from the tools, not the data.
Quick start
pipx install ai-agents-metrics
ai-agents-metrics history-update # reads ~/.codex + ~/.claude by default
ai-agents-metrics show # retry pressure, cost, session timeline
ai-agents-metrics render-html # interactive HTML report
Non-default history paths, full command list, and manual goal tracking (optional): CLI reference.
What you get
- History extraction — retry pressure, token cost, model usage from existing session files. No setup.
- HTML report — one self-contained file, summary strip + 5 trend charts, opens in any browser.
- Optional manual tracking — add goal boundaries and outcome labels on top of history for per-task breakdowns.
Not a benchmark, not an eval framework, not a model comparison tool. It is a local analysis tool for real engineering work done with AI.
Privacy
All data stays local. Writes only to:
.ai-agents-metrics/warehouse.db— local SQLite warehouse used by the history pipelinemetrics/events.ndjson— append-only event log for manual goal tracking (opt-in)docs/ai-agents-metrics.md— optional markdown export (regenerated on demand)
No data is sent to any remote service.
Links
Metadata
Release files for ai-agents-metrics 0.2.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 |
|---|---|---|---|---|
| ai_agents_metrics-0.2.2.tar.gz | 470.5 kB | With provenance | Details for ai_agents_metrics-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_agents_metrics-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for ai_agents_metrics-0.2.2-py3-none-any.whl |
Total release size: 621.8 kB
Release files / ai_agents_metrics-0.2.2.tar.gz
| Download URL | ai_agents_metrics-0.2.2.tar.gz |
|---|---|
| Size | 470.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
228b290c8f5c2c525a68dfa19bb4632a3590ec912f7ed43675950a2aae3acbc7
|
|
BLAKE2b-256 checksum How to use checksums |
884fe10873076e25e85826c279e632f28788b0a854317d2692fad4f9cd7b6f39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 21, 2026.
Transparency logRelease files / ai_agents_metrics-0.2.2-py3-none-any.whl
| Download URL | ai_agents_metrics-0.2.2-py3-none-any.whl |
|---|---|
| Size | 151.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
994a50360a5d702de0e02cf199575cef01a4bd0a120efa54f83fd0ced4c21603
|
|
BLAKE2b-256 checksum How to use checksums |
e09298c72ec0ad1f6024048c161ea3c8b2388c5a1a8d0fea8f86f5b0739bbf91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 21, 2026.
Transparency logSecurity for ai-agents-metrics 0.2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ai_agents_metrics-0.2.2.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 Apr 21, 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.