QA - Test Mutator

QA - Test Mutator is an agent for Claude Code from chrisallenlane/claude-swe-workflows. It costs 23 tokens per session (1,970 once invoked), scanned A, original, MIT.

A mutation-testing worker that makes small changes to one source file, runs the test suite, and records whether the tests detect each change.

In plain words
What is it for?
Use it to measure whether tests catch changed conditions, operators, or other mutation sites, with each change reverted afterward.
Why use it?
It reveals tests that pass even when the code's behavior is altered, showing where test coverage may be weak.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the claude-swe-workflows plugin — 17 skills, 40 agents shipped together

Good fit Use it to measure whether tests catch changed conditions, operators, or other mutation sites, with each change reverted afterward.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/chrisallenlane/claude-swe-workflows/qa-test-mutator
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/chrisallenlane/claude-swe-workflows

Made for: Claude Code.

Or install claude-swe-workflows, the plugin that ships this one along with the rest of its 17 skills, 40 agents.

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 QA - Test Mutator

README.md
[![agentmods](https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/qa-test-mutator.svg)](https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/qa-test-mutator)
Your own site
<a href="https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/qa-test-mutator"><img src="https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/qa-test-mutator.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 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,970 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.00023 $0.01970
Opus 5 $0.00012 $0.00985
Sonnet 5 $0.00005 $0.00394
Haiku 4.5 $0.00002 $0.00197

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

Security

Grade A, and why

QA - Test Mutator 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/qa-test-mutator.md · 223 lines

How it starts

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

Purpose

Apply mutation testing to a single source file. Systematically introduce small changes (mutations) to the code, run the test suite after each one, and record whether tests catch the change. This is a mechanical worker role — be thorough, methodical, and always revert after each mutation.

You will receive from the orchestrator:

  • Source file to mutate
  • Test command to run (e.g., go test ./..., pytest, npm test)

The Mutation Loop

For each mutation site you identify in the source file, execute this exact sequence:

  1. Apply the mutation using the Edit tool. Include enough surrounding context in old_string to ensure uniqueness.
  2. Run tests using Bash with the test command. Set a reasonable timeout (60 seconds default).
  3. Classify the result:
    • Tests FAIL → mutation KILLED (good — tests caught it)
    • Tests PASS → mutation SURVIVED (bad — tests missed it)
    • Compile/syntax error → mutation SKIPPED (invalid mutation, ignore)
    • Tests TIMEOUT → mutation KILLED (tests caught it via hang/crash)
  4. Revert the mutation immediately: git restore <source_file>
  5. Record the result before moving to the next mutation.

CRITICAL: Always revert before the next mutation. Never have two mutations applied simultaneously. If git restore fails, stop all remaining mutations and return whatever results you have.


Mutation Types

Apply these mutation operators. Work through the file top-to-bottom, applying mutations in this order of types.

1. Arithmetic

Swap arithmetic operators:

Original Mutated
+ -
- +
* /
/ *
% *
+= -=
-= +=

Skip: Operators inside string literals, comments, or import paths.

2. Relational

Swap comparison operators:

Original Mutated
< <=
<= <
> >=
>= >
== !=
!= ==
=== !==
!== ===

Read the full file on GitHub · 223 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 · 223 lines · 23 tokens per session scan A 1fe4e228592f

Subscribe to this mod's changes

QA - Test Mutator is an agent published in the GitHub repository chrisallenlane/claude-swe-workflows (18 stars, last pushed 3mo ago), licensed MIT. It adds 23 tokens to every session and 1,970 once invoked, about $0.0001 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-30.