/jev-test-filter:jev-test-filterfrom jev-test-filter
Selects only tests affected by a git diff for vitest, jest, node:test, bun:test, Playwright, cargo test, go test, or rspec. Falls back to full suite on errors.
Ships in jev-test-filter. 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.
Read when SKILL.md points to them.
Scores every test in a repository against a git diff and emits the filter
arguments the runner already understands. One state (the diff) plus one
question per test, answered by Jev in a single round
trip — measured at 1.3 seconds and $0.00098 for a suite of 110.
Selection is an optimization, never a correctness gate. Every failure path — no API key, a Jev error, a missing answer, no tests found, a diff too large to send whole — falls back to running everything and says why on stderr.
The skill is not the command. npx jev-test-filter runs it without installing;
pnpm add -D jev-test-filter puts it in the project. It needs Node 24 or newer,
git, and TYPESAFE_API_KEY in the environment; --format rust and
--format go also need cargo and go on the PATH.
Check for the key before recommending the tool. Without one it does not fail — it reports that it is running everything and exits 0, which is a correct answer and a useless one, and the user will reasonably wonder what they paid for.
--exec. Do not compose the command by hand.jev-test-filter --base main --exec -- vitest run
jev-test-filter --base main --format node --exec -- node --test
jev-test-filter --base main --format bun --exec -- bun test
jev-test-filter --base main --format playwright --exec -- npx playwright test
jev-test-filter --verify-snapshots --json
jev-test-filter --base main --format go --exec -- go test
jev-test-filter --base main --format rust --exec -- cargo test
jev-test-filter --base main --format rspec --exec -- bundle exec rspec
--exec hands argv straight to spawn with no shell in between. Every other
shape has a way to go wrong:
--verify-snapshots is a separate read-only review of changed Vitest text
snapshots. It reports a risk score and confidence per changed .snap file (or
inline snapshot edit). Jev does not produce free-form reasons. It
ignores images, does not edit snapshots, and does not fail CI.
runner $(jev-test-filter ...) is broken. Test names contain spaces, so
the output is shell-quoted, and an unquoted $(...) word-splits without
re-parsing the quotes. Use eval "runner $(jev-test-filter ...)" if you
genuinely need the string.--json is the mistake this skill exists to
prevent. See the table below.node --test a.test.js --test-name-pattern X silently ignores the flag.
The tool emits the flag first; keep that order if you move it.vitest -t "" runs the
whole suite; node --test --test-name-pattern "" is rejected outright.
"Everything" is the absence of the flag.--format. There is no
single command that runs Vitest and Playwright, so the tool asks instead of
guessing, and exits 1. This is the one failure that is not a fail-safe.--format rust and --format rspec are required and never automatic.
Listing cargo's tests builds the test targets, and the tool does not start
a compile nobody asked for. _spec.rb files are skipped unless asked for so
a Rails app's front-end vitest run does not become a mixed-framework
error.Measured, not assumed. Getting a row wrong is silent.
| Runner | Full name | Selection | Watch for |
|---|---|---|---|
| vitest, jest | joined " > " | -t '^(?:A|B)$' + files | pattern order does not matter |
| node:test | joined " " (one space) | --test-name-pattern '^(?:A|B)$' + files | flag must precede the files; one flag only — a pattern matching a suite runs all its children |
| bun:test | joined " " (one space) | --test-name-pattern '^(?:A|B)$' + files | The reporter shows Cart > totals, but the name pattern matches Cart totals. |
| @playwright/test | runner-listed project, file and titles | --test-list <file> with --exec; otherwise file:line | --exec first collects with --list --reporter=json, including generated tests and project variants. |
| cargo test | joined "::" | -- --exact A B C | names come from cargo test -- --list; a module path one segment wrong selects nothing |
| rspec | joined " ", none before #/./:: after a class | spec/a_spec.rb:12:30, one per file | never by name, and each example by its last line: RSpec runs the declaration nearest at or above a line, and records it(\n "a"\n) do at its last line, so its first line runs the example before it |
| go test | joined "/" | -run '^(?:TestA|TestB)$' + ./pkg | filters per top-level function: -run takes one hierarchical pattern and a second -run replaces the first. Pass a bare go test — a ./... you add stays in the package list and every package is compiled anyway |
Go scores per subtest — --json shows it — but selects whole top-level
functions, because "all of TestA, but only x of TestB" cannot be expressed and
the shape that covers TestB would drop TestA's other subtests.
jev-test-filter: 11/89 tests selected (pattern)
--json gives every test with its score (0–3), confidence, reason and
selected. The reasons:
| reason | meaning |
|---|---|
touched | the test's own body is in the diff — selected without asking, costs no tokens |
scored | at or above the cutoff (default 2.0) |
unsure | near the cutoff and the model was not confident — selected to be safe |
dynamic | the title is not a literal (.each, an interpolated template, a table-driven t.Run) so it cannot be named — always selected |
missing | no usable answer — selected, because no answer is not a passing grade |
below | under the cutoff |
Exit codes: 0 run it, 3 nothing was selected, 2 bad arguments, 1 the tool could not decide (the multi-framework case).
ARGS=$(jev-test-filter --base main --format node)
case $? in
0) eval "node --test $ARGS" ;;
3) echo "no test can be affected by this change" ;;
*) exit 1 ;;
esac
Each successful run writes .jev-test-filter/last.json, and the same record to
.jev-test-filter/records/<head_sha>.json. A run that falls back leaves both
alone, so the last complete scoring is always there.
jev-test-filter --replay .jev-test-filter/last.json --cutoff 1.0 --json
Re-gates offline, no request, spent: null, under the gate the record was
decided under unless --cutoff, --unsure-below or --unsure-margin says
otherwise. Lower the cutoff to select more.
Scoring is not deterministic — boundary tests move between runs — so if a
stable selection matters, take it once and re-derive it with --replay.
The scoring costs about a second and a tenth of a cent, and that cost scales with the number of tests and the size of the diff — not with how long the tests take. It is worth it when a test costs more than that to run — Playwright suites, integration tests that start a database, anything compiled. A millisecond-per-test unit suite will not notice the saving, and the latency may exceed it.
references/runners.md — the measurements behind the table, and how each
runner was probed.references/ci.md — GitHub Actions wiring, and what to do about the
non-determinism.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mizchi/jev-test-filter --plugin jev-test-filterOther plugins' skills for the same job