sg4tech

AI Agents Metrics — AI skill for Claude Code

AI community

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

How to install AI Agents Metrics

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

What AI Agents Metrics does

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

Alternatives in AI

  • Codeburn — Free, local tool to track AI coding token usage and cost across 37 tools and agents (Claude Code, Cursor, Code 9.7k ★
  • Ccstatusline — by sirmalloc - A highly customizable status line formatter for Claude Code CLI that displays model info, git b 5.5k ★
  • Manifest — Real-time cost observability for OpenClaw agents — track tokens, costs, messages, and model usage 4.1k ★

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 retries — attempt_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 ranking — Explore 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