Driftproof

One line in a Jest rules file made Claude's tests miss bugs

What did Report 021 find?

  • What we tested. We gave Claude a Jest rules file from the awesome-cursorrules list and asked it to write tests for 12 small projects with bugs planted in them.
  • What we found. With the file, Sonnet's tests caught every planted bug in 2.5% of attempts against 65.8% with no file (share of attempts that caught every bug), and caught 9.5 points fewer of the planted bugs, 85.3% against 94.8% (share of planted bugs caught).
  • What the comparison means. Each rules file was given to the model as always-on text. The editors decide for themselves when to attach a rule, and they add their own instructions; we reproduce neither.
  • Re-running models. On a Linux host whose system files reproduce the pinned base image, you can re-run the selected model attempts with the public runner and your own API key. New results can differ from the published values. See the report folder's Re-run the models instructions. Runtime preparation has not been verified on other hosts. The key mode has not been run against a live key.

Rules-file quality report

We gave Claude a Jest rules file from the awesome-cursorrules list and asked it to write tests for 12 small projects with bugs planted in them. With the file, Sonnet's tests caught every planted bug in 2.5% of attempts against 65.8% with no file (share of attempts that caught every bug), and caught 9.5 points fewer of the planted bugs, 85.3% against 94.8% (share of planted bugs caught). One line in the file asks for 3 to 5 tests per file. When we removed just that line and ran again, the drop went away for Sonnet on both measures, and for Haiku on the share of attempts that caught every bug.

Each task plants 20 bugs, so 120 attempts face 2,400 planted bugs. A bug counts as caught when the model's tests pass on the correct code and fail on the bugged copy. Haiku figures include 5 attempts re-run after the test setup lost them (see Limits). Tests written: test() and it() calls (with their .each, .only and .skip forms) in the test files the model added, counted in its finished project; a call inside a loop or a test.each table counts once. Every starter project already had 19 tests, which no attempt changed and which are not counted.
Jest tasks, 120 attempts per cellSonnet, no fileSonnet, with fileHaiku, no fileHaiku, with file
Share of attempts that caught every bug65.8% (79)2.5% (3)33.3% (40)5.0% (6)
Share of planted bugs caught94.8%85.3%92.7%83.9%
Tests written per attempt (median)3110357

The two measures tell one story at different scales. Most single bugs are still caught with the file (the share of planted bugs caught falls by 9.5 points for Sonnet and 8.8 for Haiku). But a test file with fewer tests almost always misses at least one, so the share of attempts that caught every bug collapses.

Limits

  • Single-turn tasks. One prompt per attempt, in a small starter project. There was no back-and-forth with a person.
  • Not run inside Cursor, Copilot or Windsurf. Each rules file was given to the model as always-on text. The editors decide for themselves when to attach a rule, and they add their own instructions; we reproduce neither.
  • Two Claude models only: Claude Haiku 5.5 and Claude Sonnet 5.5, through Claude Code. Other models may react differently.
  • One judge: Claude Opus 5.5, one score per attempt, for qualities tests cannot check. No number on this page rests on the judge.
  • 12 tasks per topic, 10 attempts per task and arm.
  • Who wrote and checked the tasks. An OpenAI Codex agent (gpt-6-astra) wrote the tasks, hidden tests, reference solutions and planted bugs from the four topics alone, without seeing any rules file. Separate Claude review agents checked them blind. A fairness review then went through every failing check against real attempts, and fixed or removed unfair ones. Machine checks confirmed that every reference solution passes its hidden tests and that every planted bug can be caught.
  • Lost and re-run attempts. The test setup lost 31 of 4,560 attempts (crashes, out-of-memory kills, one timeout). In the Jest comparison, all 11 lost attempts were re-run once, after their original runs, and all completed. In the other three topics, the 20 lost attempts were not re-run, and those shares are over the attempts that completed (at most 3 lost per arm). Counting every lost attempt as a failure changes no conclusion.
  • Two pauses. The full run paused twice on a usage limit (20 Nov for about 25 minutes, and 21 to 23 Nov). Each run resumed from its saved progress.
  • The re-run comparison mixes date and run order. The original runs did each task's 10 attempts per arm as one block. The removal run interleaved the arms on a later day. So a gap between them could come from either.

What removing the line showed

We ran the Jest tasks again on one day with three versions side by side: the file without that one line, the full file, and no file. Everything else stayed the same: the tasks, the planted bugs, the test setup, the models and the judge.

Tests written are counted as in the first table: tests the model added, not the starter's 19.
Removal run, 120 attempts per cellWithout the lineFull fileNo file
Sonnet
Share of attempts that caught every bug69.2% (83)8.3% (10)64.2% (77)
Share of planted bugs caught95.1%86.3%97.1%
Tests written per attempt (median)411030
Haiku
Share of attempts that caught every bug43.3% (52)8.3% (10)34.2% (41)
Share of planted bugs caught92.1%86.7%93.6%
Tests written per attempt (median)461036

How far it goes, measure by measure. Each change below is in percentage points, with its 95% range (resampling the 12 tasks):

Without the line, we could not tell the file apart from no file. Against no file on the same day, the differences were +5.0 points (Sonnet) and +9.2 points (Haiku) on the share of attempts that caught every bug, and −2.0 and −1.5 points on the share of planted bugs caught. Every one of those ranges includes zero. So the rest of the file neither helped nor hurt in a way we could detect.

On the second day, no file gave nearly the same results: on the share of attempts that caught every bug, 64.2% against 65.8% for Sonnet and 34.2% against 33.3% for Haiku. The full file stayed far below no file but scored a little higher than in the original run: Sonnet's share of attempts that caught every bug was 8.3% against 2.5% (+5.8 points, 1.7 to 10.0), and Haiku's share of planted bugs caught was 86.7% against 83.9% (+2.8 points, 0.9 to 5.0).

The file, and what the line does

The file is rules/jest-unit-testing-cursorrules-prompt-file.mdc in the awesome-cursorrules list on GitHub. It last changed on 13 May 2026 (commit 4467ad4). We used its text without the 5-line header (the description, globs and alwaysApply lines and their fences), which Cursor reads as settings rather than instructions. The line we removed is item 8:

**8** **Test Quantity**: Limit to 3-5 focused tests per file for maintainability

The line does what it says. It limits the number of tests to keep a test file maintainable, which is a fair goal. Each task asked for one test file, so the line applied directly. With the full file, the models wrote a median of 7 (Haiku) and 10 (Sonnet) tests in the main run, and 10 each in the removal run. With no file, they wrote 30 to 36. What nobody could see without measuring is the cost. Fewer tests left more planted bugs uncaught, and far fewer attempts caught every one.

In Cursor this file is set to attach automatically when a matching file is in context. We gave it as always-on text in every attempt, so we measured the text, not Cursor's choice of when to use it.

The other three files: we could not show any help

We measured three more files the same way, each on its own topic. The main measure here is the share of attempts where every hidden test passed. None of the files showed a gain over no file on that measure.

Share of attempts where every hidden test passed; 120 attempts per cell, less up to 3 lost. "Tasks scoring the same in every arm" counts tasks with an identical share under no file, the file, a same-length irrelevant text and same-length generic advice. Every one of those sat at 0% or at 100%.
File, topicModelNo fileWith fileChange, points (95% range)Tasks scoring the same in every arm
GitHub Copilot security instructions, securityHaiku55.8%63.0%+7.1 (−4.5 to +23.0)6 of 12
GitHub Copilot security instructions, securitySonnet60.0%60.8%+0.8 (0.0 to +2.5)11 of 12
Windsurf "Honey" rules, general codeHaiku64.4%67.2%+2.9 (−2.5 to +8.7)4 of 12
Windsurf "Honey" rules, general codeSonnet72.0%71.4%−0.8 (−5.0 to +3.3)7 of 12
Cursor Python FastAPI rules, FastAPIHaiku88.1%85.0%−3.3 (−8.3 to 0.0)5 of 12
Cursor Python FastAPI rules, FastAPISonnet93.3%95.8%+2.1 (−5.4 to +10.8)6 of 12

Ceiling caveat: many tasks gave the same result whatever the model was given, either always passing or never passing, so on those tasks no file could have shown a gain. For Sonnet on security, that was 11 of 12 tasks. "We could not show any help" is what these numbers support. They do not show that the files cannot help.

On the second measure, the share of hidden tests passed, one comparison cleared our bar. For Haiku, the Windsurf file scored +1.3 points over no file (+0.03 to +2.8). Generic advice of the same length, written from the topic alone, scored +1.1 (+0.04 to +2.4) on the same measure. So we cannot tie that gain to this file.

How we measured

What you cannot reproduce yet

Check it yourself

The twelve receipts are on Zenodo: 10.5281/zenodo.24519141.

The report folder contains the manifest with hashes, the three analysis outputs, the frozen task suite and the five rules texts. The Jest text is c8c5f92e…; without the line it is c3bffb31….

From a checkout of the public repository, download the twelve files and run the offline script. It refuses any file whose hash does not match. It also checks the JSON hash after decompression and the receipt hash, and refuses missing or extra files.

mkdir -p report-021-receipts
curl --fail --location 'https://zenodo.org/records/24519141/files/main-fastapi-haiku.json.gz?download=1' --output report-021-receipts/main-fastapi-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-fastapi-sonnet.json.gz?download=1' --output report-021-receipts/main-fastapi-sonnet.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-jest-haiku.json.gz?download=1' --output report-021-receipts/main-jest-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-jest-sonnet.json.gz?download=1' --output report-021-receipts/main-jest-sonnet.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-security-haiku.json.gz?download=1' --output report-021-receipts/main-security-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-security-sonnet.json.gz?download=1' --output report-021-receipts/main-security-sonnet.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-utilities-haiku.json.gz?download=1' --output report-021-receipts/main-utilities-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/main-utilities-sonnet.json.gz?download=1' --output report-021-receipts/main-utilities-sonnet.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/removal-jest-haiku.json.gz?download=1' --output report-021-receipts/removal-jest-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/removal-jest-sonnet.json.gz?download=1' --output report-021-receipts/removal-jest-sonnet.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/rerun-jest-haiku.json.gz?download=1' --output report-021-receipts/rerun-jest-haiku.json.gz
curl --fail --location 'https://zenodo.org/records/24519141/files/rerun-jest-sonnet.json.gz?download=1' --output report-021-receipts/rerun-jest-sonnet.json.gz
npm i --no-save @babel/parser@7.29.14
node scripts/analyze-report-021.js --receipts report-021-receipts --check

Run record

Report #021. Driftproof measures whether a rules file or skill changes what a model does.

Every Driftproof result in one file: JSONL or CSV, and what a row is and is not.

Want a skill measured, or think a result is wrong? It's free: how to ask.

Words with a dotted line link to the glossary, where each is explained in plain words.