Using RedMachine with a coding assistant
The loop
RedMachine is built to sit beside a coding assistant, not to replace it. The roles are split on purpose.
- The assistant writes the change and the tests for it.
- RedMachine judges the change. It breaks each changed line, runs the tests, and reports which lines no test noticed.
- The assistant writes a test for each SURVIVED line, using the broken version RedMachine printed as the thing the new test must catch.
- RedMachine runs again. The loop ends when the result is PASS.
The reason for the split is simple. An assistant that checks its own tests is marking its own work. RedMachine has no opinion. A line is killed or it survived.
What you need first
RedMachine works in a git repository with at least one commit, and it needs a command that runs your tests. Judging also needs a licence key. You buy the key on the buy page and run redmachine activate YOUR-KEY yourself, on the machine, one key per machine. The instruction you give the assistant tells it to stop and ask you if the licence is missing, because buying and activating are yours to do.
The instruction
RedMachine comes with a block of text to paste into your assistant's chat, in the project where it works. In six steps, it tells the assistant to do the following.
- Find the program and confirm it runs. Work in a git repository. Add
redmachine-receipt.jsonlto.gitignore. Stop and tell you if there is a licence problem. - Run
redmachine --listand keep thebase:,test:andchanged lines:lines for the final answer. If it counts no lines, stop. - Run
redmachine. Exit 0 is PASS and 1 is FAIL. For any other code, show you the message and stop. If the tests already fail with nothing broken, fix that first. - For each SURVIVED line, read the
line:andbroken as:text. Write a test that fails with the broken version and passes with the real line. Do not change the line, do not weaken or delete tests, and do not add anything to the waiver file. - Run again and repeat until PASS, or until only UNVIABLE lines are left. If a line still survives after two tries at a test, stop and say which line and what was tried.
- In the final answer, show you the three lines from step 2 and the last RESULT line. List every UNVIABLE line with its text. Leave the receipt alone.
The instruction also says what to do in a few special cases. If a surviving line is redundant, because other code already does its job, the assistant must not weaken tests or waive the line. It names the line, explains why, proposes deleting it, and stops for you to decide. If lines come back NOT_TRIED because of the --max limit, the assistant runs redmachine --max 200.
Notice who decides what. The assistant does the writing. You decide about UNVIABLE lines, redundant lines, and anything the assistant could not fix.
Which models we tried
The instruction is a request. What an assistant does with it depends on the assistant. We gave several models the same job with no help: install RedMachine, add a function with tests to a Python project, run RedMachine, and fix what it found by following the instruction. The models page has the full table. The results:
- Claude Sonnet 5.5 finished with every changed line proven in 4 of 4 runs. Claude Haiku 5.5 did so in 5 of 5, and Claude Haiku 4.5 in 6 of 7. One early run of Haiku 4.5 looped on a single line, and none did after we rewrote the instruction.
- Qwen3.8-27B at q8_0 with 65k context finished 4 of 4 and used 40.6 GiB. At Q4_K_M with 32k context it finished 3 of 4 and used 26.4 GiB.
- In our trials nothing of 20B or under got through. gpt-oss-20b could run the tool, but no run finished the whole job. Qwen2.5-Coder-7B and Qwen3-4B did not get through the install or the steps.
The page is clear about what this is. "Tried" does not mean "supported". These are our own results, on one task, with few runs each. No model added a waiver, weakened a test or edited a receipt. If you run a local model, the page suggests a 27B-class model: 32 GB of memory runs one at Q4, and 48 GB runs it at q8.
Checking that it did what you asked
A PASS says that no counted line survived. It does not say the code does what you asked. One way to close that gap is to name the tests. Ask the assistant to write one test for each thing you asked for and to name each test after it, for example heavy_orders_get_the_surcharge. The receipt lists the tests that ran with nothing broken and, for each KILLED line, the tests seen to fail with it broken. With Python's built-in commands, which stop at the first failure, that is only the first one. You can read that list against your request. The command redmachine verify RECEIPT --ran heavy_orders_get_the_surcharge answers yes or no from the record. If the receipt holds no names, it says it cannot tell.
The names come from what your test runner printed, and a test that sets out to deceive can imitate one. You can also give the receipt and your original request to a second assistant and ask whether everything you asked for has a test that went red.
Before you run it
RedMachine runs your tests against code it has broken on purpose, and a break can do whatever the broken code can do. If your project deletes files, kills processes or sends anything, run it in CI, a container or a throwaway account. To see how to read what comes back, read how to read a RedMachine receipt.