Fix a bug with your coding agent
Hand a bug to Claude Code, Codex or Cursor and let Rehearsal prove the fix with a test.
This example hands Bug #5, Saved card disappears after signing in, to your coding agent. The agent reads the bug with Rehearsal's tools, asks Rehearsal to reproduce it, fixes your code and asks Rehearsal to check the fix. You end with a fixed bug and a test that catches it if it ever comes back.
Before you start Link to Before you start
- Your coding agent has Rehearsal's tools, as Find and fix bugs with your coding agent sets up, and works in Parcel's repository.
- Parcel runs on your computer at
http://localhost:3000and is connected withrehearsal connect web http://localhost:3000, as Test an app on your computer shows. - Bug #5 is open under Bugs, found by an exploration of that address. The check of a fix runs where the bug was seen, so here it runs on your computer, against the code your agent changes.
Ask your agent Link to Ask your agent
Open Bug #5's report and press Copy prompt for your coding agent. With your CLI signed in, it copies the prompt below without its middle paragraph. Paste it into your agent and add that paragraph, because the order matters: Rehearsal checks a fix with the test that saw the bug happen, so the bug has to be reproduced while the old code still runs.
Fix bug #5 in the Parcel project that Rehearsal found: Saved card disappears after signing in. Read it with the Rehearsal tools: the steps, what was expected and what happened. Before you change any code, ask Rehearsal to reproduce the bug and wait until it has. Find the cause in this codebase and fix it. Then check the fix with Rehearsal and tell me the result.
What the agent does Link to What the agent does
Step 1: Reads the bug
The agent calls
show_buganddownload_bugand reads what was expected, what happened and the steps that led there.Step 2: Reproduces it
The agent calls
reproduce_bug. Rehearsal writes a test from the bug's steps and runs it againsthttp://localhost:3000, and once the test sees the saved card disappear, it keeps the test. Until the fix is checked, that test stands under Tests marked Reproduction.Step 3: Fixes the code
The agent finds the cause in Parcel's code and fixes it, holding the change to the expected behaviour. Once your dev server has picked up the change, the fixed code is what
http://localhost:3000serves, which is the address the bug was seen on.Step 4: Checks the fix
The agent calls
verify_bug, and Rehearsal runs the kept test again in the same environment against the same expected behaviour. Then the agent tells you what it changed and what the check said.
An agent without MCP does the same with the CLI: rehearsal bugs reproduce 5 and rehearsal bugs verify 5, each with --wait.
What you get Link to What you get
When the check passes, Bug #5 shows Fixed under Bugs, and its report says Rehearsal checked the fix. with Open the test. The kept test is now marked Regression and runs with your other tests, so a run catches the bug if it comes back.
If the test still sees the bug, the check says so and the bug stays open, so the agent can look again and ask for another check. Saying a bug is not a bug stays with you: the agent has no tool for it.
Where the check runs
The check runs where the bug was seen. For a bug seen on https://parcel.example, deploy the fix there before the agent checks it, or the test finds the old code.
What it costs Link to What it costs
Reproducing a bug and checking a fix use none of your plan's test runs. Once the test is a regression test, each run of it counts like any other test.