prompt-ab
A Claude Code skill that measures whether an edit to your system prompt actually changed the output, or whether you are looking at randomness.
You read an article, watch a video, or have an idea. You add a rule to CLAUDE.md. The next answer looks better. Did the rule do that?
Usually you cannot tell. The same prompt on identical input can vary by 68% run to run. That is not a hypothetical: it is the measurement that caused this skill to exist. A single run made a variant look 55% better than the baseline. Three runs showed the variant was slightly worse.
prompt-ab runs the same task through several prompt variants, counts what changed, establishes how noisy the model is before reporting any difference, and renders every answer side by side so you can read them rather than trust a number.
What it is not
It does not tell you which answer is better. Counters measure length, structure and banned phrases; they cannot rank quality. For that you need a judge, and Anthropic already ships two things in that space: the skill-creator plugin, whose loop grades skill-on against skill-off outputs with assertions, and claude plugin eval, which runs eval cases against a plugin with a no-plugin baseline arm.
This is the cheap, deterministic counterpart. No judge, no containers, no scoring model. It answers a narrower question: did the text change, by how much, and is that more than the noise?
Install
As a plugin:
claude plugin marketplace add MarcinSufa/claude-prompt-ab
claude plugin install prompt-ab@claude-prompt-ab
Or as a bare personal skill:
git clone https://github.com/MarcinSufa/claude-prompt-ab ~/.claude/skills/prompt-ab
Both load the same root SKILL.md: the plugin manifest points its skills at the repository root ("skills": "./"), so the clone layout and the plugin layout are one tree. Claude Code picks up ~/.claude/skills/*/SKILL.md automatically. Requirements: Python 3.10+ (python3) and the claude CLI on PATH. No third-party packages.
Quick start
# the skill directory: this is the git clone; for the plugin, `claude plugin list` shows where it lives
SKILL=~/.claude/skills/prompt-ab
# 1. create the workdir skeleton
python3 "$SKILL/scripts/ab.py" --workdir ./prompt-ab report
# 2. put your input in prompt-ab/article.md, and a task in prompt-ab/task.md
# task.md holds the user prompt with {ARTICLE} where the input goes
# 3. write the prompt you want to test
cp "$SKILL/templates/example-variant.md" ./prompt-ab/variants/v1.md
# 4. measure: baseline three times to set the noise floor, v1 once
python3 "$SKILL/scripts/ab.py" --workdir ./prompt-ab run v1 --ref-repeat 3
# 5. open ./prompt-ab/report.html
--workdir goes before the subcommand; --effort, --model, --timeout and the repeat options go after run. On Windows use python or py -3 in place of python3.
Or just ask Claude Code: "A/B this system prompt change" (or "przetestuj ten prompt A/B"), and the skill triggers on its own.
What you get
| arm | n | text tok | spread | vs baseline | thinking | em dash | tics | ref codes | time |
|----------|--:|---------:|:--------:|------------:|---------:|--------:|-----:|----------:|------:|
| baseline | 3 | 600 | 526..603 | - | 340 | 0 | 0 | 0 | 19.6s |
| v1 | 3 | 658 | 614..820 | +10% | 308 | 0 | 0 | 0 | 20.4s |
| v2 | 3 | 379 | 350..643 | -37% | 186 | 0 | 0 | 5 | 13.8s |
Read the spread column first. Each row shows that arm's own min..max; the baseline row is the noise floor. A variant whose median falls inside the baseline's band is indistinguishable from randomness, no matter how good the percentage looks. A variant's own band shows how stable it is: v2 above swings from 350 to 643.
report.html carries the same table plus every answer rendered side by side, in light and dark:
- Each column pins its name and its metrics while the answer scrolls, so a number is never read against the wrong arm.
- One panel holds the shared input, so the file still makes sense a week later.
- Each column holds the exact system prompt behind it.
- A diff viewer compares any two prompt versions, line by line, so you can see which edit produced which number.
Arms