Find the bugs hiding in your test suite
βββββββββββββββββββββββββββββββββββββββββ
β Your Code β Morris β Better Tests β
βββββββββββββββββββββββββββββββββββββββββ
This is a fork of Marc Brooker's morris. Key differences:
- Claude Code skill instead of Bedrock β the original used AWS Bedrock for AI reasoning; this fork uses a Claude Code
/morrisskill, so no API keys or AWS setup needed - Markdown + YAML output β
cargo morris discoveroutputs markdown with YAML frontmatter and fenced code blocks instead of a single-line JSON blob with escaped newlines - Diff-style mutation input β mutation plans use a
## file:line/- original/+ mutatedformat instead of JSON, which is less error-prone for LLMs to generate - File/directory targeting β you can run morris on specific files or directories (
/morris src/lib.rs) - Dropped serde/serde_json dependencies β the simpler text formats eliminated the need for JSON serialization
Morris is a Claude Code skill that performs intelligent mutation testing on Rust projects. Instead of exhaustively testing thousands of mutations, Morris uses AI to strategically select 5-8 high-value mutations that are most likely to reveal gaps in your test coverage.
Morris splits work between deterministic code (file discovery, test execution, mutation application) and AI reasoning (selecting mutations, analyzing results). The deterministic parts run as a cargo subcommand. The AI parts are handled by Claude Code β no API key required if you have a Claude subscription.
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β Your Code β βββ> β Morris β βββ> β Test Gaps β
β + Tests β β (Fixed Flow) β β + Fixes β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
ββ Discovers files (deterministic)
ββ Runs baseline tests (deterministic)
ββ AI selects mutations (Claude Code)
ββ Tests mutations (deterministic)
ββ AI analyzes results (Claude Code)
- Claude Code installed
- A Rust project with tests
# Install the cargo subcommand
cargo install --git https://github.com/JulienEllie/morris
# Install the Claude Code skill (global β works in any project)
mkdir -p ~/.claude/skills
cp -r .claude/skills/morris ~/.claude/skills/morrisIn any Rust project, open Claude Code and type:
/morris
That's it! Claude will discover your source files, propose mutations, test them, and analyze the results.
You can also target specific files or directories:
/morris src/lib.rs
/morris src/parser/
Morris uses a fixed, deterministic workflow. Claude Code provides the AI reasoning, while the cargo-morris binary handles all file I/O, test execution, and mutation application.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Morris Workflow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. π Discovery (deterministic) β
β ββ Recursively finds .rs files under src/ β
β β
β 2. π Read Sources (deterministic) β
β ββ Reads all source files into memory β
β β
β 3. β±οΈ Baseline (deterministic) β
β ββ Runs `cargo test` to verify and measure timing β
β β
β 4. 𧬠Mutation Plan (AI β Claude Code) β
β ββ Claude proposes 5-8 strategic mutations β
β β’ Operators: > β <, + β -, == β != β
β β’ Boundaries: 0 β 1, len() β len()-1 β
β β’ Logic: && β ||, true β false β
β β
β 5. π§ͺ Testing Loop (deterministic) β
β For each mutation: β
β ββ Backup original file β
β ββ Apply mutation to single line β
β ββ Run tests (with 3x baseline timeout) β
β ββ Restore original file β
β β
β 6. π Results Summary (deterministic) β
β ββ Counts killed / survived / build errors β
β β
β 7. π‘ Analysis (AI β Claude Code) β
β ββ Claude explains surviving mutations and β
β suggests specific tests to catch them β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Morris exposes three subcommands used by the /morris skill. You don't normally call these directly, but they're available if you want to integrate Morris into other workflows.
| Command | Description |
|---|---|
cargo morris discover [paths...] |
Find source files, read them, run baseline tests. Outputs markdown. |
cargo morris test --timeout <secs> |
Read mutation plan from stdin, test each mutation, output results. |
cargo morris apply --timeout <secs> |
Read analysis text from stdin, auto-apply suggested tests. |
All subcommands accept -v / --verbose for debug logging.
> /morris
𧬠Morris v0.3.0 - Mutation Testing
π Discovering source files...
src/lib.rs
π Reading source files...
β±οΈ Running baseline tests...
β
Baseline passed in 1.2s (mutation timeout: 30.0s)
[Claude proposes 6 mutations...]
π§ͺ Testing 6 mutations...
[1/1] src/lib.rs:42 - Change > to <... β SURVIVED
[2/2] src/lib.rs:67 - Change + to -... β SURVIVED
[3/3] src/lib.rs:89 - Change == to !=... β
KILLED
[4/4] src/lib.rs:23 - Change >= to >... β
KILLED
[5/5] src/lib.rs:51 - Change true to false... β SURVIVED
[6/6] src/lib.rs:15 - Remove bounds check... π§ BUILD ERROR
π Results: 2 killed, 3 survived out of 5 testable mutations
[Claude analyzes surviving mutations and suggests specific tests...]
cargo-mutants is an excellent exhaustive mutation testing tool. Morris takes a different approach:
cargo-mutants β Exhaustive Approach
- Systematically generates all possible mutations
- Tests hundreds/thousands of mutations
- AST-based pattern matching
- Comprehensive coverage analysis
- Best for: CI/CD pipelines, audits
Morris β AI-Guided Approach
- Fixed workflow, AI used only for selection & analysis
- Selects 5-8 strategic mutations
- Contextual explanations of why mutations survive
- Best for: Interactive development, learning
The biggest difference is that mutants is a lot more mature, and probably more useful in production code bases for now.
# Pass -v to any subcommand for debug logging
cargo morris discover -v
cargo morris test -v --timeout 30Morris separates deterministic operations from AI reasoning. The cargo-morris binary handles all file I/O, test execution, and mutation application. Claude Code provides the intelligence β no API keys or separate billing required.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Morris Architecture β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββ β
β β Claude Codeβ /morris β
β β Skill β (AI reasoning) β
β βββββββ¬βββββββ β
β β β
β v β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β cargo-morris (deterministic) β β
β β β β
β β discover: find files, run baseline β β
β β test: apply mutations, run tests β β
β β apply: inject new tests, verify β β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ