flaky-test-triage

flaky-test-triage is a skill for Claude Code, Codex from orlando-japan/claude-code-setting. It costs 40 tokens per session (1,036 once invoked), scanned A, original, MIT.

A guide for finding and fixing flaky tests, which are tests that pass or fail unpredictably. It checks whether failures come from timing, shared test data, or the test environment.

In plain words
What is it for?
It helps reproduce intermittent failures, compare isolated and full-suite runs, temporarily quarantine affected tests, and investigate causes such as missing waits, shared state, clock differences, network issues, and limited resources.
Why use it?
It prevents teams from repeatedly retrying failed tests and overlooking real problems, especially in continuous integration (CI) systems that run tests automatically.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps reproduce intermittent failures, compare isolated and full-suite runs, temporarily quarantine affected tests, and investigate causes such as missing waits, shared state, clock differences, network issues, and limited resources.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orlando-japan/claude-code-setting/flaky-test-triage
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 orlando-japan/claude-code-setting --skill flaky-test-triage
Clone the repo
git clone --depth 1 https://github.com/orlando-japan/claude-code-setting

Made for: Claude Code, Codex.

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 flaky-test-triage

README.md
[![agentmods](https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/flaky-test-triage/github.svg)](https://agentmods.dev/skills/orlando-japan/claude-code-setting/flaky-test-triage)
Your own site
<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/flaky-test-triage"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/flaky-test-triage/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 flaky-test-triage

Your own site · 80×15
<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/flaky-test-triage"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/flaky-test-triage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,036 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.00040 $0.01036
Opus 5 $0.00020 $0.00518
Sonnet 5 $0.00008 $0.00207
Haiku 4.5 $0.00004 $0.00104

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

Security

Grade A, and why

flaky-test-triage 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 8d 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.

templates/extra/skills/flaky-test-triage/SKILL.md · 88 lines

How it starts

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

Flaky test triage

A flaky test is a broken test. It teaches the team to retry until green, which trains the team to ignore failures — including real ones.

Rule of the house: zero tolerance. Fix it or delete it. Don't retry.

First, confirm it's flaky

  • Run it 10 times in isolation. If it fails any of those, it's flaky.
  • Run it 10 times in parallel with the rest of the suite. If it only fails in the full-suite run, it has cross-test interference.
  • Run it on CI 10 times. If only CI fails, the bug is environmental (clock skew, network, resource contention).

Quarantine it (.skip with a linked issue) while you diagnose. Don't let it poison signal for others.

Common causes, in order of frequency

1. Async timing

  • Symptom: test passes when slow, fails when fast. Or vice versa.
  • Root cause: a promise wasn't awaited, a callback fired after the test ended, setTimeout was used as a synchronization primitive.
  • Fix: await the actual thing you're waiting on (an event, a state change). Never sleep(100) and hope.
  • Tooling: waitFor(...) helpers from your test framework.

2. Shared state between tests

  • Symptom: test passes alone, fails in the suite.
  • Root cause: global variable, module-level cache, DB row left behind, file system state.
  • Fix: setup and teardown per-test. beforeEach / afterEach. Use transactional rollback or dedicated fixtures.
  • Dig deeper: sometimes the global is in a library you depend on (process-wide singletons).

3. Non-deterministic iteration order

  • Symptom: test asserts [a, b, c] but gets [c, a, b].
  • Root cause: dict/set/map ordering, filesystem listing, DB result without ORDER BY.
  • Fix: sort before comparing, or assert with set semantics. Never assume order.

4. Real clock / real randomness

  • Symptom: test fails based on the time or a coin flip.
  • Root cause: Date.now(), Math.random(), time.time() inside the code under test.
  • Fix: inject a clock / RNG. Freeze the clock in tests.

Read the full file on GitHub · 88 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. 8d ago First seen · 88 lines · 40 tokens per session scan A d6e2733eaa79

Subscribe to this mod's changes

flaky-test-triage is a skill published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 1,036 once invoked, about $0.0002 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

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

NousResearch/hermes-agent · 16 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

experimental-code-coverage-local-debugger

Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.

chromium/chromium · 59 tokens

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

emdash-cms/emdash · 71 tokens

cli-e2e

Write, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.

ComposioHQ/composio · 62 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens