Ai Agents Metrics banner
sg4tech sg4tech

Ai Agents Metrics

AI community

Description

Track AI-agent task metrics: token cost, retry pressure, and outcome quality for Claude Code and similar tools.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

ai-agents-metrics

[![CI](https://github.com/sg4tech/ai-agents-metrics/actions/workflows/ci.yml/badge.svg)](https://github.com/sg4tech/ai-agents-metrics/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/ai-agents-metrics)](https://pypi.org/project/ai-agents-metrics/) [![Downloads](https://img.shields.io/pypi/dm/ai-agents-metrics)](https://pypi.org/project/ai-agents-metrics/) [![License](https://img.shields.io/pypi/l/ai-agents-metrics)](https://github.com/sg4tech/ai-agents-metrics/blob/main/LICENSE) [![Python](https://img.shields.io/pypi/pyversions/ai-agents-metrics)](https://pypi.org/project/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 sessions each thread contains
  • 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. Point it at your history files and see what's happening: sessions per thread, token cost, and session timeline.

**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/](docs/findings/README.md). 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-upda