prove-test-failures-pre-existing-via-clean-worktree

prove-test-failures-pre-existing-via-clean-worktree is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 192 tokens per session (1,288 once invoked), scanned A, original, MIT.

A procedure for checking whether test failures existed before your changes by running the failing tests against a clean copy of the main branch. A clean checkout is a project copy without your uncommitted changes.

In plain words
What is it for?
Use it after a test run fails, especially when the failures are outside the files you changed or when switching branches is difficult because of Git worktrees.
Why use it?
It prevents you from wasting time fixing unrelated failures or incorrectly dismissing a regression as pre-existing.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

Part of the agent-traffic-control plugin — 107 skills shipped together

Good fit Use it after a test run fails, especially when the failures are outside the files you changed or when switching branches is difficult because of Git worktrees.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree
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/agent-traffic-control --skill prove-test-failures-pre-existing-via-clean-worktree
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 107 skills.

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 prove-test-failures-pre-existing-via-clean-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree/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 prove-test-failures-pre-existing-via-clean-worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/prove-test-failures-pre-existing-via-clean-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 192 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,288 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.
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.00192 $0.01288
Opus 5 $0.00096 $0.00644
Sonnet 5 $0.00038 $0.00258
Haiku 4.5 $0.00019 $0.00129

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

Security

Grade A, and why

prove-test-failures-pre-existing-via-clean-worktree 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 7d 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.

plugins/agent-traffic-control/skills/prove-test-failures-pre-existing-via-clean-worktree/SKILL.md · 85 lines

How it starts

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

Prove test failures are pre-existing against a clean main worktree — don't guess "mine or theirs"

Problem

You finish a change, run the test suite (or a broad blast-radius set), and it reports failures. Two failure modes follow, both costly:

  1. False attribution → wasted debugging. You assume your change broke them and burn time investigating failures your diff never caused.
  2. Unproven dismissal → shipped regression. You wave them off as "probably pre-existing" with no evidence, and a real regression you DID introduce slips through under that cover.

The honest move is neither — it's a 30-second proof.

Context / Trigger conditions

  • A post-change test run shows failures, particularly in modules/areas your diff did NOT touch.
  • You're about to write "these are pre-existing, unrelated to my change" in a PR/handoff — but haven't proven it.
  • You're in a git worktree where main is checked out in another worktree (so git checkout main fails with fatal: 'main' is already used by worktree at ...), and/or you have uncommitted changes, so the usual "switch to main and run" is awkward.

Solution

  1. Spin a throwaway clean checkout of the baseline (merge base / origin/main):
    git fetch origin --quiet
    git worktree add /tmp/clean origin/main      # isolated; zero-touch to your working tree
    
    A worktree beats git stash: it doesn't disturb your edits, survives untracked files + new test assertions, and works when your own cwd is a worktree that can't switch to main.
  2. Run the EXACT failing tests there (the specific node ids, not the whole suite):
    ( cd /tmp/clean/<test-root> && <runner> <exact::failing::test::ids> )
    
  3. Compare:
    • Identical failures → pre-existing. Ship your change; note "N failures pre-existing on origin/main, not introduced here" in the PR/handoff (with the proof).
    • Different / fewer failures → your change caused the delta. Now debug — you know exactly which.
  4. Clean up: git worktree remove /tmp/clean --force.

Read the full file on GitHub · 85 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. 7d ago First seen · 85 lines · 192 tokens per session scan A a78533761446

Subscribe to this mod's changes

prove-test-failures-pre-existing-via-clean-worktree is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed yesterday), licensed MIT. It adds 192 tokens to every session and 1,288 once invoked, about $0.0010 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-09-05.