Engineering

Fix the flakiest test every week

Every week, Merlin finds the test that failed most often without a code change, fixes the cause and opens a pull request. You get the link in #eng.

@Merlin every Monday at 10:00, use gh to find the test in acme/web that failed most often last week and then passed on a rerun of the same commit. Find why it's flaky, fix the cause and open a pull request with the failure count and the evidence, then post the link here. Don't skip or delete the test or add retries; if you can't find the cause, post what you found instead.

#eng
Get started for free
  1. Starts whenA weekly schedule runs every Monday at 10:00 and posts to #eng
  2. Merlin worksClaude Code or Codex uses gh to find the test that failed most often last week and passed on a rerun of the same commit, then fixes the cause
  3. You getA pull request with the fix and the evidence, linked in #eng

Tools

  • GitHub
  • Slack

Capabilities

  • Automations
  • Integrations

How it works

From last week's CI history to a fix for the flakiest test.

A weekly schedule starts a run every Monday at 10:00 and posts to #eng.

/AcmeTeam/Automations/Fix the flakiest test every weekFeedback?O

Overview

Agents

Skills

Memory

Automations

Integrations

Settings

Fix the flakiest test every week

Pause
StatusActive
CreatorO Omar You
ScopeWorkspace
Last runOct 19, 2026, 10:00 AM

DetailsRun history

Trigger

When Merlin runs it.

RuleHow often Merlin runs it.Weekly
WeekdayThe day of the week it runs.Monday
TimeNext run Oct 26, 2026, 10:00 AM.10:00

Run

What Merlin does each time, where it runs, and where the result goes.

Run instruction

every Monday at 10:00, use gh to find the test in acme/web that failed most often last week and then passed on a rerun of the same commit. Find why it's flaky, fix the cause and open a pull request with the failure count and the evidence, then post the link here. Don't skip or delete the test or add retries; if you can't find the cause, post what you found instead.

RuntimeThe computer and coding agent that run it.Omar's MacBook Pro · Claude Code
DestinationWhere Merlin posts the result. Choose None when the instruction already acts in your tools.#eng

Before and after

Flaky tests get fixed one a week instead of rerun forever.

Without Merlin

Everyone reruns red jobs and moves on, and nobody owns finding the worst offender.

  1. 01List last week's failed runs
  2. 02Find reruns of the same commit
  3. 03Count failures per test
  4. 04Reproduce it in a loop
  5. 05Read the test and its setup
  6. 06Find the race
  7. 07Fix the cause
  8. 08Run it 200 times
  9. 09Open a pull request
  10. 10Post the link in #eng

With Merlin

Every Monday the worst flake gets a fix up for review.

  1. Every Monday at 10:00Weekly schedule posting to #eng
  2. Finds and fixes the flake on Omar's MacBookClaude Code with gh, no skips or retries
  3. Fix pull request linked in #engWith the failure count and the evidence

Setup

Sign in gh on a machine with the code, then schedule it from #eng.

Set these up once and a flake fix arrives every Monday. Whoever sends the prompt becomes the automation's creator.

  1. 01Connect a machineRuntimeInstall the Merlin desktop app or CLI on a computer running Claude Code or Codex. You can also use a machine a teammate shares with your workspace.
  2. 02Install the GitHub appIntegrationsPick the repositories Merlin can access, so it can read and link the pull requests there. Pushes use the machine owner's own Git access.
  3. 03Sign in to the gh CLIRuntimeSome steps use gh, so sign it in on the machine that runs this.
  4. 04Keep your code on the machineRuntimeMerlin reads the code in a local project on the runtime, so keep the repository checked out there.
  5. 05Add Merlin to SlackIntegrationsInstall the Slack app and add Merlin to the channel you work in. A private channel needs /invite @Merlin.
  6. 06Keep reruns in your Actions historyRuntime

    A flake here is a test that failed and then passed when the same commit's workflow was rerun, read from your GitHub Actions runs with gh. If your team never reruns failed jobs, there is nothing for it to count.

  7. 07Paste the setup promptAutomationsSend the prompt below to @Merlin in Slack, in the channel it should post to. Merlin creates the automation and tells you what it set up.

Prompt

Schedule the weekly flake fix with one message in #eng.

@Merlin every Monday at 10:00, use gh to find the test in acme/web that failed most often last week and then passed on a rerun of the same commit. Find why it's flaky, fix the cause and open a pull request with the failure count and the evidence, then post the link here. Don't skip or delete the test or add retries; if you can't find the cause, post what you found instead.

#eng

Once, when you send it

  1. PromptYou send the prompt to @Merlin
  2. AutomationMerlin creates the automation

Every scheduled run

  1. ScheduleThe schedule starts a run
  2. RuntimeMerlin picks the creator's machine first
  3. ContextThe run gathers context
  4. WorkClaude Code or Codex finds and fixes the flaky test
  5. ResultMerlin links the pull request in #eng
  6. SteeringReplies in its thread follow up

Bring your coding agents into the tools your team already uses.

Let your whole team hand work to Claude Code and Codex today. Connect one machine and add Merlin to Slack, Linear or GitHub. 14-day free trial, no API keys, no card.