Borrowing it
Nothing to install: this file belongs to swarm-ai-research/swarm. 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/swarm-ai-research/swarm/main/.claude/commands/add_metric.mdgit clone --depth 1 https://github.com/swarm-ai-research/swarmWrote 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/swarm-ai-research/swarm/add_metric)<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/add_metric"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/add_metric/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/swarm-ai-research/swarm/add_metric"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/add_metric.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.00000 | $0.00296 |
| Opus 5 | $0.00000 | $0.00148 |
| Sonnet 5 | $0.00000 | $0.00059 |
| Haiku 4.5 | $0.00000 | $0.00030 |
Grade A, and why
add_metric 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 12d 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.
What it actually says
/add_metric
Add a new metric and wire it into SWARM reporting — use when analysis reveals a measurement gap not covered by existing toxicity, quality-gap, or payoff metrics. Distinct from /add_scenario (new parameter config) and /add_domain (new task category with new observables).
Usage
/add_metric <metric_name> [where]
Examples:
/add_metric norm_violation_rate/add_metric collusion_entropy swarm/metrics/collusion.py
Behavior
- Decide where it belongs:
- Per-epoch aggregate metric:
swarm/metrics/soft_metrics.pyor a new module underswarm/metrics/. - Red-team metric:
swarm/redteam/metrics.py - Boundary/leakage metric:
swarm/boundaries/*
- Implement the metric with:
- Clear definition (units, range, failure modes)
- Determinism (given the same event log/history)
- Minimal coupling (don’t reach into private orchestrator state unless necessary)
- Wire it into reporting:
- Update the relevant reporter (often
swarm/metrics/reporters.py) so it is exported consistently. - Add/extend tests in
tests/that lock down the definition and basic sanity properties.
- Ensure it shows up in:
- CSV/JSON exports when applicable
- Any standard plots generated by
/plot(if relevant)
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.
- 12d ago First seen · 33 lines · 0 tokens per session scan A 1232b8df0c5f
add_metric is a command published in the GitHub repository swarm-ai-research/swarm (42 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 296 tokens. 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-30.
Other commands, from other repositories
story-long-scan
A command for scanning long-form online fiction rankings on platforms such as Qidian, Fanqie, and Jinjiang, then analyzing the ranking data.
story-short-scan
A tool for scanning and analysing popular short web-fiction rankings on platforms such as Zhihu Yanyan and Fanqie Short Stories.
tma1-peer
List recent sessions on this project by agent — peers (Codex, OpenClaw, Copilot CLI) or your own.
eval-merge
Use the Read tool to load .skill-compass/{skill-name}/manifest.json. Verify.
speckit.git.validate
Validate current branch follows feature branch naming conventions.
reflect
Curate and compress recent memory. This command reviews the last 7 days of journal entries, extracts durable insights, and updates long-term memory files. Think of it as memory maintenance -- moving important things from short-term to long-term storage.