ab-harness

ab-harness is a skill for Claude Code from wan-huiyan/claude-ecosystem-hygiene. It costs 199 tokens per session (5,181 once invoked), scanned C, original, MIT.

A test harness compares Claude Code’s results with your saved setup—such as memories, rules, skills, hooks, and plugins—against results from a blank environment.

In plain words
What is it for?
Use it to replay representative tasks, compare both runs, and estimate the setup’s practical effect.
Why use it?
It shows whether the setup actually improves work, instead of only showing that its files were read.

Skill for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; positional $N argument.

Part of the ab-harness plugin — 1 skill shipped together

Good fit Use it to replay representative tasks, compare both runs, and estimate the setup’s practical effect.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness
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 wan-huiyan/claude-ecosystem-hygiene --skill ab-harness
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/claude-ecosystem-hygiene

Made for: Claude Code.

Or install ab-harness, the plugin that ships this one along with the rest of its 1 skill.

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 ab-harness

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness/github.svg)](https://agentmods.dev/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness"><img src="https://agentmods.dev/badge/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness/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 ab-harness

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness"><img src="https://agentmods.dev/badge/skills/wan-huiyan/claude-ecosystem-hygiene/ab-harness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 199 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,181 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00199 $0.05181
Opus 5 $0.00100 $0.02590
Sonnet 5 $0.00040 $0.01036
Haiku 4.5 $0.00020 $0.00518

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

Security

Grade C, and why

ab-harness scanned grade C 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 11d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$DST"; mkdir -p "$DST"
plugins/ab-harness/SKILL.md · 435 lines

How it starts

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

Claude Code A/B Counterfactual Harness

Problem

The user wants to quantify whether their accumulated ~/.claude/ setup (axioms, lessons, skills, plugins, hooks, auto-memory) actually helps on representative tasks, not just whether artifacts get referenced (that's ecosystem-audit's job).

Naive attempts fail because:

  • The default Claude Code run pulls the full ~/.claude context — there's no obvious switch to "turn the setup off."
  • Simply cd-ing to a different project doesn't help — global axioms/skills still load.
  • Even with a clean env, the project repo's docs/runbooks/, docs/findings/, and in-repo MEMORY.md stay visible — the harness must either accept that leakage (measure marginal ~/.claude value) or scrub repo files too.

Context / Trigger Conditions

  • User has completed the ecosystem-audit scan (utilization %) and wants the counterfactual number next ("setup saved X turns / prevented Y pitfalls").
  • User says "I want to show colleagues my setup works," "quantify the setup," "A/B test my Claude setup," "replay a task without my memory."
  • A project plan references a counterfactual harness step — the canonical measurement stage after (1) usage audit and (2) before (3) cleanup.
  • User asks whether a specific skill / lesson / axiom pulls its weight on real work.

Solution

Step 1 — Verify the clean-env mechanism before spending a cent

The knob is CLAUDE_CONFIG_DIR. Point it at an empty dir:

mkdir -p /tmp/claude-empty
CLAUDE_CONFIG_DIR=/tmp/claude-empty claude -p --output-format json \
  "Reply JSON: {has_axioms: <bool>, num_skills_visible: <int>, session_start_hook_fired: <bool>}" \
  < /dev/null

Expected diff vs a normal run (same probe, no env var):

Signal Normal Clean (CLAUDE_CONFIG_DIR=/tmp/claude-empty)
skills visible hundreds ~10 (defaults only)
axioms auto-loaded true false
SessionStart hook fired true false
project auto-memory (~/.claude/projects/*/memory/MEMORY.md) injected empty

Read the full file on GitHub · 435 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. 11d ago First seen · 435 lines · 199 tokens per session scan C fecd9dd15d2f

Subscribe to this mod's changes

ab-harness is a skill published in the GitHub repository wan-huiyan/claude-ecosystem-hygiene (1 stars, last pushed 25d ago), licensed MIT. It adds 199 tokens to every session and 5,181 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

improve-code-quality

Guided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale. Orchestrates nine skills phase by phase - working-with-legacy-code, clean-code, refactoring-patterns, software-design-philosophy…

wondelai/skills · 227 tokens

working-with-legacy-code

Safely change and test untested codebases using Feathers' "Working Effectively with Legacy Code". Use when the user mentions "legacy code", "no tests", "untested codebase", "how do I test this", "seams", "characterization tests", "golden master", "sprout method", "afraid to change this code", "monster method"…

wondelai/skills · 188 tokens

cloudflare-workers-testing

Comprehensive testing guide for Cloudflare Workers using Vitest and @cloudflare/vitest-pool-workers. Use for test setup, binding mocks (D1/KV/R2/DO), integration tests, or encountering test failures, mock errors, coverage issues.

secondsky/claude-skills · 57 tokens

api-testing

HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.

secondsky/claude-skills · 39 tokens

bun-jest-migration

Use when migrating from Jest to Bun's test runner, import compatibility, mocks, and config.

secondsky/claude-skills · 25 tokens

bun-test-lifecycle

Use for test lifecycle hooks: beforeAll, afterAll, beforeEach, afterEach, fixtures, preload.

secondsky/claude-skills · 27 tokens