/test-case-reduction:debug-reductionfrom test-case-reduction
Diagnose problems with shrinkray test-case reduction — unexpected results, reduction getting stuck, slippage to wrong bugs, or interestingness test issues. Use when reduction output is surprising or reduction is not making progress.
Ships in test-case-reduction. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are helping the user diagnose and fix problems with their test-case reduction. Something has gone wrong — the reduced output is unexpected, reduction is stuck, or the interestingness test isn't working properly.
Symptoms:
Diagnosis: The interestingness test is too broad. The reducer found a simpler input that satisfies the test but exercises a different code path.
Fixes:
Symptoms:
Diagnosis: The interestingness test accepts inputs that don't genuinely exhibit the bug. Often: empty input causes the tool to error, and the test matches any error.
Fixes:
test -s "$1" || exit 1 to reject empty filesSymptoms:
Diagnosis possibilities:
Fixes:
gcc -E file.c > file.i) to eliminate header dependenciesSymptoms:
Diagnosis: The interestingness test gives different results on the same input. Common causes:
Fixes:
setarch $(uname -m) -R ./test.sh file.c--parallelism=1 with shrinkray to eliminate parallel interferencesleep or retry logic (but this slows reduction significantly)Symptoms:
Diagnosis: The interestingness test is slow, or timeouts are too generous.
Fixes:
-S instead of -c, -Wfatal-errors, -w (suppress warnings when they don't matter)--parallelism is set to your core count (default)time ./test.sh file.c to see where time is spentSymptoms:
Diagnosis: The reducer introduced UB during reduction. This is expected and nearly inevitable for C/C++ miscompilation bugs if the interestingness test doesn't guard against it.
Fixes:
-fsanitize=undefined-Wall -Wextra -pedantic -WerrorSymptoms:
./test.sh file.c && echo interesting works fine manuallyDiagnosis: This is almost always a temporary directory problem. shrinkray runs the test in a fresh temp directory, not your working directory. Anything that depends on your local environment will break.
Fixes:
$1 for the test case: The file argument is an absolute path and works from any directory. If the test references the file by a hardcoded relative path or basename, switch to $1.SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)".chmod +x test.sh).Quick diagnostic: Run the test from a different directory to simulate the reducer's environment:
cd /tmp && /absolute/path/to/test.sh /absolute/path/to/original_file
If this fails but running from your project directory succeeds, the test has a directory dependency.
When the user reports a problem, work through these steps:
--timeout setting (auto-calibrated by default — if the initial run is slow, the timeout may be too generous)--input-type matches how the test reads its input--volume=debug for detailed pass-by-pass progress.shrinkray/ history directory for intermediate results--also-interesting=101 in the test to record interesting-but-wrong variants--parallelism=1 to eliminate parallel-related issues--formatter=none if auto-formatting is interfering with reductionWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (drmaciver/test-case-reduction-skill) — no native marketplace selected
npx claudepluginhub p/drmaciver-test-case-reduction3 skills in this plugin
/reduceGuide the user through setting up and running test-case reduction with shrinkray. Use when the user has a file that triggers a bug and wants to minimize it./write-interestingness-testHelp write an interestingness test for shrinkray (test-case reducer). Use when the user needs to reduce a test case, write or fix an interestingness test, or is working with test-case reduction.Other plugins' skills for the same job