Borrowing it
Nothing to install: this file belongs to cbmono/ai-setup. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/cbmono/ai-setup/main/.claude/commands/my-ai-stats.mdgit clone --depth 1 https://github.com/cbmono/ai-setupWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/cbmono/ai-setup/my-ai-stats)<a href="https://agentmods.dev/commands/cbmono/ai-setup/my-ai-stats"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/my-ai-stats/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/cbmono/ai-setup/my-ai-stats"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/my-ai-stats.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.01140 |
| Opus 5.5 | $0.00008 | $0.00456 |
| Sonnet 5.5 | $0.00004 | $0.00228 |
| Haiku 4.5 | $0.00002 | $0.00114 |
Grade A, and why
my-ai-stats scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Show the user their own delegation stats for a month.
Argument (optional): a month as YYYY-MM. If $ARGUMENTS is empty, use the current month.
Run exactly this, substituting the month, then show the user the output verbatim. Do not summarise it away — the table is the answer. Add at most two sentences of comment.
python3 - <<'PY' $ARGUMENTS
import pathlib, re, sys, datetime, calendar
arg = (sys.argv[1] if len(sys.argv) > 1 else "").strip()
today = datetime.date.today()
if arg:
y, m = (int(x) for x in arg.split("-")[:2])
else:
y, m = today.year, today.month
lo = datetime.datetime(y, m, 1).timestamp()
hi = datetime.datetime(y + (m == 12), (m % 12) + 1, 1).timestamp()
root = pathlib.Path.home() / ".claude" / "projects"
SIDE = b'"isSidechain":true'
BG = b'"sessionKind":"bg"'
ENTRY = re.compile(rb'"entrypoint":"([^"]+)"')
side = bg = sdk = live = 0
for f in root.rglob("*.jsonl"):
try:
if not (lo <= f.stat().st_mtime < hi):
continue
except OSError:
continue
is_side = is_bg = False
entry = None
with f.open("rb") as fh:
prev = b""
while chunk := fh.read(1 << 22):
buf = prev + chunk
if SIDE in buf:
is_side = True
break
is_bg = is_bg or BG in buf
if entry is None and (mt := ENTRY.search(buf)):
entry = mt.group(1)
prev = buf[-32:]
if is_side:
side += 1
elif is_bg:
bg += 1
elif entry and entry.startswith(b"sdk-"):
sdk += 1
else:
live += 1
runs = side + bg + sdk + live
delegated = side + bg + sdk
print(f"\n Your Claude Code delegation — {calendar.month_name[m]} {y} (this machine)")
print(f" {'-'*58}")
print(f" {'in-process sub-agents (Agent/Task tool)':<45}{side:>6}")
print(f" {'background sessions (claude --bg)':<45}{bg:>6}")
print(f" {'headless / SDK sessions (-p, Agent SDK)':<45}{sdk:>6}")
print(f" {'interactive sessions — you steering':<45}{live:>6}")
print(f" {'-'*58}")
share = f"{100*delegated/runs:.1f}%" if runs else "--"
print(f" {'DELEGATED SHARE':<45}{share:>6}")
print(f"\n {runs} runs scanned. Nothing leaves this machine.\n")
PY
Notes to pass on if the user asks:
DELEGATED SHAREis the whole point. It is the share of your Claude Code runs that did work on your behalf — sub-agents, background sessions, headless/SDK runs — rather than you steering a thread yourself. Higher is better. If it is near zero, you are working at rung ③/④, not ⑤.- Read from
~/.claude/projectson this machine only. Nothing is uploaded; no other person's data is visible or involved. If you use more than one machine, run it on each. - Files are bucketed by last-modified time, so a session spanning a month boundary lands in the month it was last touched. Fine for a monthly trend; not exact.
- How runs are classified. Each transcript lands in exactly one bucket, checked in this
order:
"isSidechain":true→ in-process sub-agent;"sessionKind":"bg"→ background session; firstentrypointstarting withsdk-(sdk-py,sdk-cli, … — headlessclaude -pand Agent SDK runs, e.g. loopd dispatches) → headless; anything else (cli, desktop, unknown) → interactive. The first three count as delegated. An SDK app you drive by hand would be miscounted as delegated; rare in practice. - No
Task-dispatch counting. Anything derived from countingTaskdispatches in the parent transcript is unreliable — the dispatch is frequently recorded in the child's transcript instead, which undercounts the parent badly. The per-transcript markers above are what the local data records cleanly. - This exists because the org dashboard's
delegatedfigure does not count in-process sub-agent runs: one heavy user's machine showed 788 sub-agent runs in August while the whole organisation's reported figure for the same window was 287. This command measures the behaviour the dashboard cannot see.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago Changed · +22 lines · +6 tokens per session 6e95d08176d5
- 1mo ago First seen · 77 lines · 15 tokens per session scan A 442b0ef46dd8
my-ai-stats is a command published in the GitHub repository cbmono/ai-setup (2 stars, last pushed 10d ago), licensed MIT. It adds 21 tokens to every session and 1,140 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-20.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.