AI Agents Metrics — AI skill for Claude Code
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
[](https://github.com/sg4tech/ai-agents-metrics/actions/workflows/ci.yml) [](https://pypi.org/project/ai-agents-metrics/) [](https://pypi.org/project/ai-agents-metrics/) [](https://github.com/sg4tech/ai-agents-metrics/blob/main/LICENSE) [](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 > 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/](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
Related Skills
Token Autopsy
Token autopsy for agent fleets: ingest Claude Code / Codex / Cursor transcripts, emit per-behavior cost report
Cost
AI Build Cost Tracker — track how much AI costs per feature, task, and project
Tu
AI coding assistant cost tracking CLI — track token usage across Claude Code, Codex, OpenCode
Agentbill
Track token usage and dollar cost across Claude Code, Cursor, Codex and other AI coding agents. Zero-config, t
Warden Receipt
Show token-warden rule receipts — the per-rule verdict card with token savings vs. rent, per-task pass/fail, t
Xiaoyaoclaw Usage Report
OpenClaw usage & performance reporting - parse session JSONL for task duration, tool/skill/model usage, token
Related Agents
Cost Governor
Track aggregate token spend and API costs across all agent operations. Enforce budget constraints, detect cost
Performance Monitor
Monitor agent execution, track token usage, measure response quality, and optimize workflows
Omd Persona Tester
Adversarial synthetic user that walks through generated UI under a strict persona prompt with hard turn budget