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.1.tar.gz (462.7 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.1-py3-none-any.whl (147.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_agents_metrics-0.2.1.tar.gz
  • Upload date:
  • Size: 462.7 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.1.tar.gz
Algorithm Hash digest
SHA256 9d83ff33430288ba777f2fd077aa249b087544065ae245ab70903f386929d308
MD5 bd4abb841cb0b0740fb48175b16a26f4
BLAKE2b-256 348b14e6ae7a6f780879d5a0b411d94507020c98037341ca83731ce2b1debe51

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agents_metrics-0.2.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_agents_metrics-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8a6e6fa5d5a95bf274df0d8b43fe2cc80844630714d3fdf3d9a88966ad22f88
MD5 36b998306c3d065694990f7d34b4df94
BLAKE2b-256 24e0d02a07f3414dfabd4e39d2f02a6de4e24d188c7cc8c4a5ba71bfb6ac3dc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agents_metrics-0.2.1-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