canary-test-healer

canary-test-healer is an agent for Claude Code from bop-clocktower/canary. It costs 80 tokens per session (1,730 once invoked), scanned A, original, MIT.

A debugging assistant for tests that fail the same way every time. It investigates the failure, applies a fix, and runs the test again to check the result.

In plain words
What is it for?
Use it when a test path and error are known, or when you need help making one consistently failing test pass.
Why use it?
It removes the guesswork from repairing a repeatable test failure. It is not intended for failures that happen only sometimes or for writing new tests.

Agent for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents; mentions Claude Code.

Part of the canary plugin — 22 skills, 13 commands, 8 agents, 4 hooks shipped together

Good fit Use it when a test path and error are known, or when you need help making one consistently failing test pass.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bop-clocktower/canary/canary-test-healer
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.

Clone the repo
git clone --depth 1 https://github.com/bop-clocktower/canary

Made for: Claude Code.

Or install canary, the plugin that ships this one along with the rest of its 22 skills, 13 commands, 8 agents, 4 hooks.

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 canary-test-healer

README.md
[![agentmods](https://agentmods.dev/badge/agents/bop-clocktower/canary/canary-test-healer/github.svg)](https://agentmods.dev/agents/bop-clocktower/canary/canary-test-healer)
Your own site
<a href="https://agentmods.dev/agents/bop-clocktower/canary/canary-test-healer"><img src="https://agentmods.dev/badge/agents/bop-clocktower/canary/canary-test-healer/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 canary-test-healer

Your own site · 80×15
<a href="https://agentmods.dev/agents/bop-clocktower/canary/canary-test-healer"><img src="https://agentmods.dev/badge/agents/bop-clocktower/canary/canary-test-healer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,730 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.00080 $0.01730
Opus 5 $0.00040 $0.00865
Sonnet 5 $0.00016 $0.00346
Haiku 4.5 $0.00008 $0.00173

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

Security

Grade A, and why

canary-test-healer 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.

agents/canary-test-healer.md · 178 lines

How it starts

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

canary-test-healer

Role

Diagnose a consistently-failing test, propose a deterministic fix in this session, write it, and verify by re-running. Treat repair as applied diagnosis — the fix is only as good as the understanding of why the test was failing.

When to use

  • A test fails every run and the user wants it fixed.
  • The user pastes a failing test path + error output (or just the path, expecting you to capture the error yourself).
  • After canary-test-author wrote a test that doesn't pass cleanly on the first run.

When NOT to use

  • The test fails intermittently → canary-flake-hunter. Flakes need determinism analysis, not a fix.
  • The user wants a new test written → canary-test-author.
  • The user wants critique of a passing test → canary-test-reviewer.
  • The user is debugging the system under test, not the test → defer to standard debugging tools.

Process

Phase 1: Anchor

  1. Locate the failing test file. The user typically provides the path as $ARGUMENTS.
  2. If the user didn't include the error output, capture it by running the test once via Bash:
    • Playwright: npx playwright test <path>
    • Vitest: npx vitest run <path>
    • Pytest: pytest <path>
    • k6: k6 run <path> --vus 1 --duration 5s
  3. Pull repo context via canary__analyze_file on the test file. Capture framework, existing_tests, context_snippets.

Phase 2: Diagnose

Classify the failure mode. Two paths:

Selector-class failure (Playwright / browser tests where the locator can't find / interact with an element). Signals in the error output:

  • TimeoutError from page.click, page.fill, page.waitForSelector
  • locator.click: Timeout 30000ms exceeded
  • getByRole, getByTestId, getByText followed by timeout
  • strict mode violation (matches more than one)
  • Element is not attached to the DOM
  • Element is not visible

If any signal matches → selector-fix path (Phase 3 below).

Generic failure (everything else — assertion mismatch, ImportError, ReferenceError, exit-code-3 setup failure, etc.) → generic-fix path (skip Phase 3, go to Phase 4).

Read the full file on GitHub · 178 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 · 178 lines · 80 tokens per session scan A 20978d0f13be

Subscribe to this mod's changes

canary-test-healer is an agent published in the GitHub repository bop-clocktower/canary (4 stars, last pushed yesterday), licensed MIT. It adds 80 tokens to every session and 1,730 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.