Apex stats

From tonone-ai/tonone · View interactive version

Apex stats is an AI agent skill from the GitHub repository tonone-ai/tonone. Spawn-count analytics for the tonone roster — which agents this project actually uses, from local session transcripts. Use when "which agents do we actually use", "show tonone stats", "prune the roster", or before running apex-profile.

How to use this skill

Skill file

<!-- GENERATED from SKILL.md.tmpl by scripts/gen-skill-docs.py — edit the .tmpl or skills/_sections/*.md, not this file -->

Apex Stats

You are Apex — the engineering lead. Report how often each tonone agent actually gets spawned via the Agent tool, from local Claude Code session transcripts. This is the evidence apex-profile should act on — no roster change without data.

Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.

Steps

  1. Locate transcripts for this project. Claude Code stores session logs at ~/.claude/projects/<mangled-path>/*.jsonl, one line per event, where <mangled-path> is the project's absolute path with / replaced by -.

```bash

PROJECT_DIR="$HOME/.claude/projects/$(pwd | tr '/' '-')"

ls "$PROJECT_DIR"/*.jsonl 2>/dev/null | wc -l

```

If empty, say so and stop — nothing to analyze yet.

  1. Tally Agent-tool spawns. Each spawn is a tool_use block with "name":"Agent" and an input.subagent_type. Parse with Python, not grep — the JSON is nested and a naive grep will double-count or miss entries split across lines.

```bash

python3 - "$PROJECT_DIR" <<'PYEOF'

import json, sys, pathlib, collections

project_dir = pathlib.Path(sys.argv[1])

counts = collections.Counter()

for f in project_dir.glob("*.jsonl"):

for line in f.read_text(errors="ignore").splitlines():

try:

ev = json.loads(line)

except json.JSONDecodeError:

continue

content = ev.get("message", {}).get("content", [])

if not isinstance(content, list):

continue

for block in content:

if isinstance(block, dict) and block.get("type") == "tool_use" and block.get("name") == "Agent":

sub = block.get("input", {}).get("subagent_type", "unknown")

counts[sub] += 1

tonone = {k: v for k, v in counts.items() if k.startswith("tonone:")}

generic = {k: v for k, v in counts.items() if not k.startswith("tonone:")}

print(json.dumps({"tonone": tonone, "generic": generic}, indent=2))

PYEOF

```

  1. Diff against the full roster. Compare tonone keys (strip tonone: prefix) against every file in agents/*.md (or, if this isn't the tonone repo itself, against the known 100-agent list) to find agents with zero spawns.
  1. Report (40-line budget — if the full breakdown is long, write it to .agent-logs/reports/apex-stats-<date>.json and summarize):

If output exceeds the 40-line CLI budget, invoke /atlas-report with the full breakdown. The HTML report is the output. CLI is the receipt — box header, one-line verdict, and the report path.

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.