ab

An A/B testing workflow for running the same coding task through different AI model tiers and comparing their results. A/B testing means comparing two or more alternatives under similar conditions.

In plain words
What is it for?
Use it to compare model outputs, review structural and meaning-based differences, score quality, estimate cost, and write a comparison report.
Why use it?
It helps determine whether a less expensive model is good enough for a type of task instead of relying on assumptions.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/codeshux/tokenwise/ab
Any agent
npx skills add CodeShuX/tokenwise --skill ab
Clone the repo
git clone --depth 1 https://github.com/CodeShuX/tokenwise

Made for: Claude Code, Codex.

Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,242 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00076 $0.01242
Opus 5 $0.00038 $0.00621
Sonnet 5 $0.00015 $0.00248
Haiku 4.5 $0.00008 $0.00124

Measured yesterday against content hash 363fe94cb5ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ab 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 yesterday.

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/ab/SKILL.md · 98 lines

How it starts

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

/tokenwise:ab — A/B test a task across model tiers

Run the same task at multiple tiers and compare outputs.

Parse $ARGUMENTS

Expected form: <task description> [--tiers haiku,sonnet,opus,fable]

  • The task description is everything before the first -- flag (or the whole string if no flags)
  • --tiers haiku,sonnet is the default (skip Opus and Fable by default — Opus is the baseline, Fable is the priciest lane)
  • --tiers haiku,sonnet,opus runs the three cheaper tiers
  • --tiers ...,fable adds Fable — useful for calibrating the Planning lane (e.g. checking whether a task class really needs it, or whether an override pinning it to sonnet/opus is good enough). Since Fable costs 2× Opus, the cost-confirm step below should flag it

If $ARGUMENTS is empty, ask the user:

What task should I A/B test? Provide a task description (e.g., "rename getCwd to getCurrentWorkingDirectory across the codebase").

Steps

  1. Confirm cost upfront:

    A/B test will run this task <N> times (once per tier).
    Estimated cost: $<rough estimate based on task size>.
    Proceed? [Y/n]
    

    Estimate by treating the task as ~10k input + ~1k output per tier and summing. If fable is in --tiers, add one line before the prompt: Note: fable is ~2x Opus's rate and will dominate this estimate.

  2. For each tier:

    • Spawn a Task at that tier: Task(description: <task>, subagent_type: "general-purpose", model: <tier>, prompt: <task>)
    • Capture: stdout, input_tokens, output_tokens, duration_ms, errors
    • If the Task tool's model: param is silently overridden (Anthropic Issue #47488), warn user and abort with:

      Cannot A/B test on this Claude Code build — subagent model routing is not honored. See /tokenwise:install probe results.

  3. Compute diffs:

    • Structural: line count, character count, token overlap (Jaccard on word sets)
    • File-list diff: if outputs mention modified files, compare the lists
    • Semantic: spawn one more Task at Opus tier with the prompt:

      Compare these N outputs for the task "". Score each from 1-10 on (a) completeness, (b) correctness, (c) clarity. Return a JSON object: {"<tier>": {"completeness": N, "correctness": N, "clarity": N, "overall": N, "notes": "..."}}. Be honest — if two outputs are equivalent, give them the same score.

Read the full file on GitHub · 98 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. yesterday First seen · 98 lines · 76 tokens per session scan A 363fe94cb5ac

Subscribe to this mod's changes

ab is a skill published in the GitHub repository CodeShuX/tokenwise (3 stars, last pushed 6d ago), licensed MIT. It adds 76 tokens to every session and 1,242 once invoked, about $0.0004 per session on Opus 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-31.

Related

Other skills, from other repositories

archify

Create polished, validated architecture, workflow, sequence, data-flow, and lifecycle/state diagrams as explorable standalone HTML with inline SVG, dark/light themes, optional trace motion, and PNG/JPEG/WebP/SVG/WebM export. Accept plain-language requirements or pasted Mermaid flowchart, sequenceDiagram, and…

tt-a1i/archify · 130 tokens

vox-director

Turn ONE topic into a finished Vox-style paper-collage explainer / ad video, end to end on the Atlas Cloud API + local ffmpeg — script, collage keyframes, motion, voice-over, music, captions, all automated. Use this whenever the user wants a "Vox style" video, a paper/torn-paper collage animation, a "motion collage"…

Alisa0808/vox-director · 236 tokens

social-post

學習使用者的 Facebook/Instagram/YouTube/Threads/X 語氣與受眾,規劃、撰寫、確認後發佈內容;以已登入 Chrome 受控掃描、草擬及回覆 FB/IG/Threads 留言;並作為流量、留存與轉化的結構化帳本。使用者說「發文」「用我的口氣」「回覆留言」「自動回留言」「掃留言」「查流量」「演算法」「把數據訓練進去」「比較貼文」「優化 pattern」時使用。.

Hao0321/claude-skill-social-post · 135 tokens

privacy-jp

日本サービス向け(일본 서비스용) プライバシーポリシー・利用規約・同意モーダル・Cookieバナー 자동 생성. 個人情報保護法(APPI)·消費者契約法·特定商取引法 반영. Next.js 1316 프로젝트 대상.

kimlawtech/korean-privacy-terms · 74 tokens

higgsfield

Use this skill whenever the user asks anything about Higgsfield AI — writing or refining video/image prompts, choosing a model (Kling, Sora 2, Veo, Wan, Seedance, Minimax Hailuo, DoP, Soul, Nano Banana, Seedream, Flux, GPT Image, etc.), camera controls, named motion presets, Soul ID character consistency, Cinema…

OSideMedia/higgsfield-ai-prompt-skill · 147 tokens

higgsfield-camera

Use when the user asks about camera movements, shot types, or how to describe camera behavior in a Higgsfield prompt. Contains all named camera controls with descriptions, best use cases, and example prompt phrases.

OSideMedia/higgsfield-ai-prompt-skill · 47 tokens