experiment

experiment is a skill for Claude Code from SethGammon/Citadel. It costs 38 tokens per session (2,646 once invoked), scanned A, original, MIT.

An automated loop that proposes code changes, measures a single-number metric, and keeps changes that improve it. It works in isolated worktrees, which are separate copies of a repository for safe experiments.

In plain words
What is it for?
Use it when you can name the files to change, provide a command that prints one metric, and set an iteration or time budget—for example, reducing bundle size or improving test performance.
Why use it?
It lets you optimize against a measurable target while preserving the starting code and discarding changes that fail checks or do not improve the result.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .citadel/scripts/telemetry-log.cjs --event agent-complete --agent experiment --session {slug} --status {success|partial|failed}.

Part of the citadel plugin — 48 skills, 7 agents, 2 MCP servers shipped together

Good fit Use it when you can name the files to change, provide a command that prints one metric, and set an iteration or time budget—for example, reducing bundle size or improving test performance.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/SethGammon/Citadel
agentmods
npx agentmods add skills/sethgammon/citadel/experiment

Made for: Claude Code.

Or install citadel, the plugin that ships this one along with the rest of its 48 skills, 7 agents, 2 MCP servers.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sethgammon/citadel/experiment/github.svg)](https://agentmods.dev/skills/sethgammon/citadel/experiment)
Your own site
<a href="https://agentmods.dev/skills/sethgammon/citadel/experiment"><img src="https://agentmods.dev/badge/skills/sethgammon/citadel/experiment/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.

agentmods 80×15 button for experiment

Your own site · 80×15
<a href="https://agentmods.dev/skills/sethgammon/citadel/experiment"><img src="https://agentmods.dev/badge/skills/sethgammon/citadel/experiment.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,646 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 107
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00038 $0.02646
Opus 5.5 $0.00015 $0.01058
Sonnet 5.5 $0.00008 $0.00529
Haiku 4.5 $0.00004 $0.00265

Measured 9d ago against content hash 28ecdff5a9c0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

experiment 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 9d 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/SKILL.md · 238 lines

How it starts

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

/experiment — Metric-Driven Optimization Loop

Identity

Coordinate bounded metric-driven experiments in isolated checkouts, retaining candidates locally until the declared verification and independent review pass.

Orientation

When to Use

  • When you want to optimize a measurable metric (bundle size, error count, test coverage, FPS)
  • When you have a clear hypothesis but aren't sure which of several approaches wins
  • When manual A/B testing would be too slow or error-prone
  • NOT when the goal is subjective ("make it feel better") — the metric must be a number

Inputs

The user provides three things:

  1. scope: Files to modify (glob pattern, e.g., "src/api/**/*.ts")
  2. metric: Project command that outputs a single number (e.g., node tools/bundle-bytes.cjs)
  3. budget: Iteration cap (default: 5) or time cap (e.g., "10 minutes")

Ask only for missing inputs that cannot be resolved from the request or project. The metric MUST exit successfully and output a single finite number to stdout.

Protocol

Step 1: BASELINE

  1. Read project instructions and inspect the checkout, index, untracked files, and active worktrees. Record the source commit and dirty-file hashes/status. Leave user work in place: never stash, reset, clean, switch branches, or commit unrelated changes to make an experiment possible.
  2. Create a dedicated worktree at an explicit commit, or a separate local clone at that commit. Verify its path, HEAD, and clean status before running commands. If the requested baseline includes authorized working changes, copy only those changes into the isolated checkout, preserving deletions and file contents; verify their hashes and commit the snapshot there. Leave the original index and files untouched. If the intended snapshot is unclear, clarify before copying.
  3. Before iterations, write the evaluation plan in the experiment report: source and snapshot commits, allowed source scope, metric command and direction, timeout, repeat/noise policy, and required typecheck, regression and behavioral checks. Record any inapplicable check and its reason now, not after a failure. Ask about direction only if ambiguous. A scalar is a proxy, not acceptance.
  4. Freeze the evaluator: record hashes for the metric implementation, test assertions, fixtures/expected outputs, and relevant command/config files. These are outside candidate edit scope, even if a broad glob includes them. Keep the original incumbent commit, evaluator and plan fixed for the run.
  5. Pin one file-byte representation before measuring, including checkout filters and line endings. Compare baseline and evaluator hashes with their committed blobs; for commit-based evaluation, materialize matching bytes in the isolated checkout. Use the same representation for every candidate and independent check; a clean Git status alone does not establish byte identity.
  6. Measure the baseline and run the declared checks in isolation. Record commands, exit codes, values and evidence paths. An invalid baseline or required-check failure holds optimization until resolved; do not silently waive the check.

Read the full file on GitHub · 238 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago Changed · +74 lines · -1 tokens per session 28ecdff5a9c0
  2. 1mo ago First seen · 164 lines · 39 tokens per session scan A 3ce2d3dd5c96

Subscribe to this mod's changes

experiment is a skill published in the GitHub repository SethGammon/Citadel (927 stars, last pushed 3d ago), licensed MIT. It adds 38 tokens to every session and 2,646 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other skills, from other repositories

compose-org

Run a task as an evolved multi-agent ORG using the installed liquid-org framework — where YOU (the running Claude) embody the org: you ask liquid-org which proven team topology + specialist personas to use (retrieved from its evolved pool, or assembled fresh), then dispatch ONE SUBAGENT PER TALENT to play each role…

U0001F3A2/liquid-org · 226 tokens

liquid-rank

Rank the available skills by RELEVANCE to the current task, on demand, using liquid-org's read-only hermes skill ranker. This is an EXPLICIT, OPT-IN selector you invoke WHEN you want help choosing the most relevant skill for what you're doing — it is NOT default, automatic skill selection, and it does NOT decide for…

U0001F3A2/liquid-org · 198 tokens

present-gate

First-officer gate-presentation rendering — the captain-facing gate-review template and assembly rules, including workflow-owned finding labels. Invoke at the gate point after the FO has decided a stage must be presented.

spacedock-dev/spacedock · 44 tokens

audit-project

Run an iterative multi-agent code audit until critical and high findings are resolved. Use when the user says "audit my code", "find all the bugs", "deep code audit", "iterative review", or "review until clean".

OutlineDriven/odin-claude-plugin · 50 tokens

prototype

Use when asked to prototype one design question through a cheap logic or UI experiment, including button-driven state-model checks. Not for polished artifacts: use polished-web-prototype.

OutlineDriven/odin-claude-plugin · 36 tokens

tmux-layout

Use this skill when the operator wants a prepared tmux visualization layout for the session's side-channels (STATE.md tail, CI-watch, events.jsonl tail). Renders a 4-pane default layout or debug layout. Read-only side-channel observability — the coordinator chat stays in the operator's original terminal. Trigger…

Kanevry/session-orchestrator · 99 tokens