experiment-loop

experiment-loop is a skill for Claude Code, Codex from aaronnat23/disp8ch. It costs 0 tokens per session (831 once invoked), scanned A, original, MIT.

A test-and-measure loop for improving code against a chosen benchmark. It keeps successful changes in Git and reverts unsuccessful ones.

In plain words
What is it for?
Use it to reduce test time or file size, improve accuracy, run repeated experiments, and record the changes that worked.
Why use it?
It replaces guesswork with measured comparisons while checking that an improvement does not break correctness.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to reduce test time or file size, improve accuracy, run…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aaronnat23/disp8ch/experiment-loop
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.

Any agent
npx skills add aaronnat23/disp8ch --skill experiment-loop
Clone the repo
git clone --depth 1 https://github.com/aaronnat23/disp8ch

Made for: Claude Code, Codex.

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 experiment-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/aaronnat23/disp8ch/experiment-loop.svg)](https://agentmods.dev/skills/aaronnat23/disp8ch/experiment-loop)
Your own site
<a href="https://agentmods.dev/skills/aaronnat23/disp8ch/experiment-loop"><img src="https://agentmods.dev/badge/skills/aaronnat23/disp8ch/experiment-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 831 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.00000 $0.00831
Opus 5 $0.00000 $0.00415
Sonnet 5 $0.00000 $0.00166
Haiku 4.5 $0.00000 $0.00083

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

Security

Grade A, and why

experiment-loop 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 3d 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/experiment-loop/SKILL.md · 66 lines

How it starts

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

Experiment Loop (Metric-Driven Optimization)

Autonomous benchmark-driven experiment loop: propose a change, measure the metric, keep what improves it, revert what doesn't, repeat. Git is the ledger — every kept improvement is a commit. Every discarded attempt is a clean revert.

Setup

Before iterating, call init_experiment to configure the session:

  • metric_name: the scalar to optimize (e.g. test_duration_ms, accuracy_pct, bundle_size_kb)
  • metric_direction: "minimize" or "maximize"
  • objective: plain-English goal (e.g. "Reduce test suite wall-clock time below 10s")
  • benchmark_command: shell command that must print METRIC <name>=<number> to stdout
  • checks_command (optional): correctness guard (e.g. npm test or python -m pytest) — a failed check blocks a keep even if the metric improved (Goodhart's Law prevention)

Loop

  1. Propose: read autoresearch.ideas.md for queued ideas; pick the most promising and describe the change
  2. Implement: make the code change using write_file or bash_exec
  3. Measure: call run_experiment with a description of what was tried
  4. Decide: call log_experiment with:
    • decision="keep" if metric improved AND checks passed → git commit
    • decision="discard" if metric regressed or was flat → git revert
    • decision="checks_failed" if metric improved but correctness check failed → revert
    • decision="crash" if the benchmark itself crashed → revert
  5. Record ideas: append promising-but-deferred ideas to autoresearch.ideas.md
  6. Repeat

Benchmark Contract

The benchmark command MUST print at least one METRIC name=number line to stdout:

METRIC test_duration_ms=4231
METRIC memory_mb=128

Secondary metrics are captured automatically. The primary metric is whatever metric_name was set to in init_experiment.

Segment-Aware Baselines

Call init_experiment again mid-session to start a new baseline segment — useful when pivoting to a different optimization goal. Old results are preserved in autoresearch.jsonl with their original segment index.

Read the full file on GitHub · 66 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. 3d ago First seen · 66 lines · 0 tokens per session scan A 2f14aba39335

Subscribe to this mod's changes

experiment-loop is a skill published in the GitHub repository aaronnat23/disp8ch (99 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 831 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-09-03.