mutation-test

mutation-test is a command for Claude Code from nwiizo/ccswarm. It costs 0 tokens per session (526 once invoked), scanned A, original, MIT.

A mutation-testing command for Rust projects using cargo-mutants. Mutation testing makes small changes to code and checks whether the test suite notices them.

In plain words
What is it for?
Use it on a Rust crate to find detected, missed, timed-out, or unbuildable mutations and decide where additional tests are needed.
Why use it?
It exposes tests that pass normally but fail to detect important code changes, showing where coverage is weak.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it on a Rust crate to find detected, missed, timed-out, or unbuildable mutations and decide where additional tests are needed.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nwiizo/ccswarm/mutation-test
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/nwiizo/ccswarm

Made for: Claude Code.

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 mutation-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/nwiizo/ccswarm/mutation-test/github.svg)](https://agentmods.dev/commands/nwiizo/ccswarm/mutation-test)
Your own site
<a href="https://agentmods.dev/commands/nwiizo/ccswarm/mutation-test"><img src="https://agentmods.dev/badge/commands/nwiizo/ccswarm/mutation-test/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 mutation-test

Your own site · 80×15
<a href="https://agentmods.dev/commands/nwiizo/ccswarm/mutation-test"><img src="https://agentmods.dev/badge/commands/nwiizo/ccswarm/mutation-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 526 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.00000 $0.00526
Opus 5.5 $0.00000 $0.00210
Sonnet 5.5 $0.00000 $0.00105
Haiku 4.5 $0.00000 $0.00053

Measured 1mo ago against content hash b15220210445, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mutation-test 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 1mo 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.

.claude/commands/mutation-test.md · 79 lines

How it starts

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

/mutation-test - Mutation Test Execution

Uses cargo-mutants to run mutation tests and verify test quality.

Execution Content

  1. Check if cargo-mutants is installed
  2. Run mutation tests on specified crate
  3. Analyze results and report undetected mutants (survivors)

Commands

# Installation check
cargo mutants --version || cargo install cargo-mutants

# List mutants (pre-execution check)
cargo mutants --list -p <crate-name>

# Run mutation tests
cargo mutants -p <crate-name> --timeout 120 -j 4

# Check results
cat mutants.out/caught.txt    # Detected mutants
cat mutants.out/missed.txt    # Undetected mutants (needs improvement)
cat mutants.out/timeout.txt   # Timed out mutants

Result Interpretation

Result Meaning Action
caught Tests detected the mutant Good, no action needed
missed Tests failed to detect the mutant Tests need to be added
timeout Test execution timed out Consider adjusting timeout value
unviable Mutant cannot be built No action needed

Areas to Focus On

  • Functions with many missed mutants have insufficient test coverage
  • Prioritize addressing missed in business logic (usecase/)
  • missed in error handling (error/) is also important

Example Output

317 mutants tested
- 280 caught (88%)
- 20 missed (6%)
- 10 timeout (3%)
- 7 unviable (2%)

Reference

  • cargo-mutants documentation
  • Mutation testing is a technique for measuring test quality
  • "Killing a mutant" = Tests can detect code changes

Execution Steps

Run mutation tests on the ccswarm crate:

# 1. Installation check
cargo mutants --version || cargo install cargo-mutants

# 2. Check mutant list (optional)
cargo mutants --list -p ccswarm | head -50

# 3. Run mutation tests (parallel 4, timeout 120 seconds)
cargo mutants -p ccswarm --timeout 120 -j 4

# 4. Display results summary
echo "=== Caught ===" && wc -l mutants.out/caught.txt
echo "=== Missed ===" && cat mutants.out/missed.txt
echo "=== Timeout ===" && wc -l mutants.out/timeout.txt

Read the full file on GitHub · 79 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. 1mo ago First seen · 79 lines · 0 tokens per session scan A b15220210445

Subscribe to this mod's changes

mutation-test is a command published in the GitHub repository nwiizo/ccswarm (153 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 526 tokens. 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.