ab-harness

Measures whether a Claude Code setup improves task outcomes via counterfactual A/B and layered-ablation runs.

1|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill ab-harness-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ab-harness
Source: https://github.com/wan-huiyan/claude-ecosystem-hygiene/tree/main/plugins/ab-harness
Command: npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill ab-harness-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reference counts and usage audits show which parts of your ~/.claude setup get touched, but not whether they actually improve answers. This Skill runs controlled experiments — the same tasks with your full setup versus a clean environment — to quantify the real impact of your memories, lessons, axioms, skills, and hooks on turns, tool calls, cost, and pitfall prevention. ## Core Features & Use Cases - Binary A/B testing: Run matched tasks with setup-ON versus setup-OFF using CLAUDE_CONFIG_DIR isolation, with pinned model, permission mode, and stdin controls for fair comparison. - Layered ablation: Strip one layer at a time (CLAUDE.md, axioms, lessons, skills/plugins, auto-memory, in-repo docs) across 12 cells to rank which layers actually prevent pitfalls. - JSONL transcript mining: Extract turn counts, tool-call histograms, files read, skills invoked, and pitfall keyword hits from session logs, with recovery from rate-limit stubs and orchestration race conditions. - Use Case: After an ecosystem audit flags your HOT artifacts, run this harness on 3-15 tasks to produce an honest report showing colleagues whether your setup saves turns, prevents pitfalls, or is pure overhead — then feed the ranked layer list to memory-hygiene for pruning decisions. ## Quick Start Ask the AI to run an A/B test comparing your current Claude Code setup against a clean environment on a few representative tasks and report the difference in turns, cost, and pitfall prevention.

Frequently Asked Questions about ab-harness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I A/B test my Claude Code setup?▼

Run each task twice with identical prompts: once normally and once with CLAUDE_CONFIG_DIR pointed at an empty directory. Pin the model, use --permission-mode bypassPermissions, redirect stdin from /dev/null, and compare turns, tool calls, cost, and pitfall hits from the JSON output.

What is the difference between binary A/B and layered ablation?▼

Binary A/B compares full setup versus clean environment to measure overall value, costing about $2-10. Layered ablation strips one layer at a time across 12 cells to rank which specific layers (skills, lessons, CLAUDE.md, docs) prevent pitfalls, costing $11-80 depending on runs per cell.

Does CLAUDE_CONFIG_DIR fully isolate the clean environment?▼

No. It isolates global CLAUDE.md, axioms, skills, hooks, and project auto-memory, but in-repo files like docs/runbooks and MEMORY.md remain visible. The harness measures the marginal value of the ~/.claude layers, not the total setup.

Why did my orchestrator lose run outputs during parallel execution?▼

The CLI opens output files with truncate semantics, so racing subprocesses can zero out completed runs. Treat the per-session JSONL transcript as ground truth, avoid wait -n on older bash, and add rate-limit stub detection before re-running cells.

When should I not use this A/B harness?▼

Skip it for quick checks — it costs $10+ and 30 minutes to 3 hours. Use cheaper scans like ecosystem-audit for utilization questions first, and only run this harness when you need counterfactual evidence that artifacts change outcomes.

How many tasks do I need for reliable A/B results?▼

n=3 is a pilot that provides evidence, not proof. Target n>=5 tasks for a real effect-size estimate, and always declare the sample size, task selection bias, and single-shot variance in the report.