metrics

metrics is a skill for Claude Code from scolladon/craft. It costs 53 tokens per session (1,463 once invoked), scanned A, original, MIT.

A read-only usage-reporting tool that examines saved conversation transcripts for the current code repository. It reports token use, cost, cache performance, and suggestions about choosing models for different work.

In plain words
What is it for?
Use it to inspect repository-level AI usage, find transcript locations, review spending and caching, and inform model-routing choices.
Why use it?
It turns raw transcript records into usage information and records a no-op when transcripts are missing or unusable, so missing data does not stop the workflow.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the craft plugin — 20 skills, 4 commands, 9 agents, 1 hook shipped together

Good fit Use it to inspect repository-level AI usage, find transcript locations, review spending…

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add scolladon/craft
Claude Code
/plugin install craft

Made for: Claude Code.

Or install craft, the plugin that ships this one along with the rest of its 20 skills, 4 commands, 9 agents, 1 hook.

Wrote 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.

agentmods badge for metrics

README.md
[![agentmods](https://agentmods.dev/badge/skills/scolladon/craft/metrics.svg)](https://agentmods.dev/skills/scolladon/craft/metrics)
Your own site
<a href="https://agentmods.dev/skills/scolladon/craft/metrics"><img src="https://agentmods.dev/badge/skills/scolladon/craft/metrics.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,463 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.01463
Opus 5 $0.00026 $0.00732
Sonnet 5 $0.00011 $0.00293
Haiku 4.5 $0.00005 $0.00146

Measured 6d ago against content hash 5a73e4b7fa95, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

metrics 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 6d 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.

skills/metrics/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

craft:metrics — usage-telemetry front door

Standalone session-owned skill. You (the session) probe the current repo's transcript directory, invoke the miner, and report the output paths. No worker agent is spawned. This skill is ADVISORY — an absent, empty, or malformed transcript directory produces a recorded no-op and exits 0; it is never a blocker.

Input: $ARGUMENTS (zero-argument; optional pass-through flags accepted if the user supplies them — see Step 1).

Shell entry: scripts/mine-transcripts.sh is a shell convenience wrapper around the same miner for direct terminal use (e.g. bash scripts/mine-transcripts.sh). It is equivalent to invoking this skill but bypasses the skill preamble checks.


Preamble — read-only probe

Before invoking the miner, confirm the environment and resolve where transcripts would live.

1. Plugin root

Confirm ${CLAUDE_PLUGIN_ROOT} is set and the entrypoint exists:

test -f "${CRAFT_ROOT:-${CLAUDE_PLUGIN_ROOT}}/engine/bin/usage-mine.js"

If the test fails, surface a diagnostic and stop — the plugin installation is incomplete.

2. Transcript directory

The miner resolves the transcript directory for the current working directory internally (cwd → dashes mapping). You do not need to construct or validate the path yourself. An absent or empty directory is within the miner's advisory contract — it writes a no-data report and exits 0. Never abort the skill on a missing directory.


Procedure

Step 1 — Mine

Run the miner with zero arguments (or forward any flags the user explicitly supplied):

node "${CRAFT_ROOT:-${CLAUDE_PLUGIN_ROOT}}/engine/bin/usage-mine.js"

Optional flags (pass through verbatim when the user supplies them):

Flag Purpose
--dir <path> Override the resolved transcript directory
--baseline <path> Baseline report for delta comparison and drift detection — e.g. the committed docs/contributing/metrics-baseline.report.json snapshot
--threshold <n> Relative-delta threshold for the drift signal (default 0.25); only used when --baseline is also supplied
--since <date> Restrict to transcripts on or after this date
--prices <path> Custom pricing table (JSON)
--no-inline Exclude the main-loop usage group (included by default)

Read the full file on GitHub · 131 lines

Changes

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.

  1. 6d ago First seen · 131 lines · 53 tokens per session scan A 5a73e4b7fa95

Subscribe to this mod's changes

metrics is a skill published in the GitHub repository scolladon/craft (2 stars, last pushed 18d ago), licensed MIT. It adds 53 tokens to every session and 1,463 once invoked, about $0.0003 per session on Opus 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-08-31.