experiment

A command that describes, runs, compares, and ranks cross-agent coding experiments. An experiment matrix runs the same test across selected agents or variants and repeats it when requested.

In plain words
What is it for?
Use /experiment with a plain-English description or structured flags to compare coding agents on a task and produce a ranked report.
Why use it?
It combines experiment setup, execution, and comparison so results can be evaluated in one workflow.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/fwornle/coding/experiment
Clone the repo
git clone --depth 1 https://github.com/fwornle/coding

Made for: Claude Code.

Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,965 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00027 $0.05965
Opus 5 $0.00014 $0.02982
Sonnet 5 $0.00005 $0.01193
Haiku 4.5 $0.00003 $0.00596

Measured yesterday against content hash 5c3dc10bd259, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

experiment scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

if ! curl -sf -m 3 http://localhost:3032 >/dev/null 2>&1; then
.claude/commands/experiment.md · 372 lines

How it starts

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

Experiment (/experiment) — describe → run → compare in one command

Wrap the full cross-agent experiment flow as a single operator command: synthesize a spec (from a plain-English description or from headline flags), run the whole matrix, then auto-compare the variants and print the ranked table (and write the report JSON the dashboard Comparison tab reads live).

Two ways to invoke — same pipeline (Step 0 chooses):

  • Natural language (default): just describe the experiment, e.g. /experiment compare Claude Sonnet against OpenCode Haiku on writing a fizzbuzz function, run each twice. The skill synthesizes the spec, shows you a preview + drafted test, and asks you to confirm before spending tokens.
  • Structured flags (power users): /experiment run --goal "…" --variants A,B --agents claude,opencode --repeats N.

This skill is a THIN wrapper (D-09). It shells to three existing CLIs and reimplements NO runner, serialization, or comparison logic:

  • scripts/experiment-write-spec.mjs — builds, validates, and persists the spec YAML to config/experiments/gen-<id>.yaml (so it lists in the dashboard Launch listbox + is re-launchable).
  • scripts/experiment-run.mjs — runs the matrix (spec-file driven; RUN-02/03/04, Phase 78).
  • scripts/experiments-compare.mjs — aggregates + ranks the Runs and writes the report JSON.

The ONLY skill-side computation is re-deriving the task_hash (the sha256 the runner itself computes at close) so the run→compare handoff is mechanically closed — no manual lookup, no scraping of runner stdout.

DO NOT pre-solve the task. The analysis IS the experiment. The whole point is to compare how each agent independently investigates and solves the task, in its own isolated sandbox. The orchestrator's job is to turn the user's description into a GOAL_SENTENCE and run the matrix — never to read the codebase, locate the bug, design the fix, or otherwise do the work before running. Doing so contaminates the comparison (you'd be feeding one agent's answer to all cells) and defeats the purpose. Write the goal from symptoms + the observable deliverable the user described (e.g. "the REC indicator wrongly toggles between black and green — make it stable"), optionally with a one-line orienting pointer the user themselves gave, and let each cell do its own analysis. If you catch yourself grepping the target code to "craft a better goal," stop — that is the cells' job.

Parallel is the default execution mode. Run cells concurrently (Step 4) unless the user explicitly asks for serial/sequential execution, or the matrix includes an agent whose tokens must be measured and that agent is ambient-slot-bound (opencode — see Step 4). Only then fall back to serial.

Read the full file on GitHub · 372 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. yesterday First seen · 372 lines · 0 tokens per session scan A 5c3dc10bd259

Subscribe to this mod's changes

experiment is a command published in the GitHub repository fwornle/coding (2 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 5,965 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.