Skip to main content

CLI for tracking AI agent task metrics: token cost, retry pressure, and outcome quality.

Project description

ai-agents-metrics

CI PyPI Downloads License Python

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.

HTML report preview — 5 charts over 25 goals, 243 practice events, 16 days

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 retriesattempt_count > 1 is 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 rankingExplore 2.63×, code-reviewer 3.25×, commit 0.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 pipeline
  • metrics/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

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

ai_agents_metrics-0.2.2.tar.gz (470.5 kB view details)

Uploaded Source

Built Distribution

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

ai_agents_metrics-0.2.2-py3-none-any.whl (151.3 kB view details)

Uploaded Python 3

File details

Details for the file ai_agents_metrics-0.2.2.tar.gz.

File metadata

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

File hashes

Hashes for ai_agents_metrics-0.2.2.tar.gz
Algorithm Hash digest
SHA256 228b290c8f5c2c525a68dfa19bb4632a3590ec912f7ed43675950a2aae3acbc7
MD5 1841311d7a8c32c6dbd74c0039be04c0
BLAKE2b-256 884fe10873076e25e85826c279e632f28788b0a854317d2692fad4f9cd7b6f39

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agents_metrics-0.2.2.tar.gz:

Publisher: publish.yml on sg4tech/ai-agents-metrics

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

File details

Details for the file ai_agents_metrics-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_agents_metrics-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 994a50360a5d702de0e02cf199575cef01a4bd0a120efa54f83fd0ced4c21603
MD5 2012aa8ff2e259b28e8ee4cdf635b2bc
BLAKE2b-256 e09298c72ec0ad1f6024048c161ea3c8b2388c5a1a8d0fea8f86f5b0739bbf91

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agents_metrics-0.2.2-py3-none-any.whl:

Publisher: publish.yml on sg4tech/ai-agents-metrics

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