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/log_run.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/log_run)<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/log_run"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/log_run.svg" alt="Measured on agentmods" 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.00850 |
| Opus 5 | $0.00000 | $0.00425 |
| Sonnet 5 | $0.00000 | $0.00170 |
| Haiku 4.5 | $0.00000 | $0.00085 |
Grade A, and why
log_run 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 8d 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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/log_run
Log a completed SWARM run to the SQLite runs database.
Usage
/log_run <run_dir> [--notes "..."] [--external-run-id "..."]
Examples:
/log_run runs/20260209-143000_collusion_detection_seed42/log_run runs/20260209-143000_baseline_seed42 --notes "Increased rep decay to 0.15"/log_run runs/20260209-143000_pi_safety_seed42 --external-run-id "your-external-run-id"
Behavior
-
Read
<run_dir>/history.json(preferred). If missing, read CSV files under<run_dir>/csv/. If neither exists, error out with instructions. -
Extract summary metrics from the run data:
scenario_id: from directory name or history metadatarun_timestamp: from directory name (YYYYMMDD-HHMMSS)seed: from directory name or history metadatan_agents: count of unique agent IDsn_epochs: number of completed epochssteps_per_epoch: from history metadata or scenario configtotal_interactions: count of all interactionsaccepted_interactions: count of accepted interactionsacceptance_rate: accepted / totalavg_toxicity: mean toxicity across epochs (E[1-p | accepted])final_welfare: last epoch's welfare valuetotal_welfare: sum of welfare across all epochswelfare_per_epoch: total_welfare / n_epochsadversarial_fraction: fraction of agents with type containing "adversarial" or "redteam"collapse_epoch: first epoch where welfare drops to 0 and stays 0 (NULL if no collapse)external_run_id: from--external-run-idflag or NULL (e.g. Prime Intellect eval/job ID)notes: from--notesflag or empty string
-
Locate or create the SQLite database at the path from
$SWARM_RUNS_DB_PATHenv var, or default toruns/runs.db. If thescenario_runstable does not exist, create it:
CREATE TABLE IF NOT EXISTS scenario_runs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
scenario_id TEXT NOT NULL,
run_timestamp TEXT,
seed INTEGER,
n_agents INTEGER,
n_epochs INTEGER,
steps_per_epoch INTEGER,
total_interactions INTEGER,
accepted_interactions INTEGER,
acceptance_rate REAL,
avg_toxicity REAL,
final_welfare REAL,
total_welfare REAL,
welfare_per_epoch REAL,
adversarial_fraction REAL,
collapse_epoch INTEGER,
external_run_id TEXT,
notes TEXT,
logged_at TEXT DEFAULT (datetime('now'))
);
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.
- 8d ago First seen · 81 lines · 0 tokens per session scan A 12d792ece7b7
log_run is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 850 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.
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.
checklist
Generate a custom checklist for the current feature based on user requirements.