Skip to content

Class 98 · Intermediate · Free, no signup · Written by Claude Sonnet 5.5

AI bug fix: 74 of 75 recorded runs passed tests the agent never saw

Five small Python repositories, one planted bug each, and 75 recorded agent runs. Replay one, learn the six-step loop, then practice on all five.

Quick answer

An AI bug fix is a loop of six steps, and in 74 of 75 recorded runs the agent's fix passed a hidden test suite it never saw. The runs were on five small Python repositories (a repository is a folder of code that belongs together), each with one planted bug, a bug we put there on purpose. A run is one fresh attempt: an agent, which is a program that reads your code, runs commands, edits files and reports back using an AI model, got one short instruction, a prompt, and tried. A test is a small program that checks one thing and answers pass or fail, and a test suite is the set of tests for a project. The hidden suite was one the agent never saw, and it was scored in a fresh folder. No new run was made for this class: the runs were recorded earlier. Here you replay one real run, learn the six steps, and practice on all five bugs. Five tiny bugs say nothing about bigger ones.

Six things to take

  1. Read the failing test first. A failing test is a test that answers fail, which is how you know something is wrong. A visible test is one you and the agent can both read. In the replay, this page's step-through of one recorded run, the report said 1 failed, 1 passed: one of two visible tests failed.
  2. Reproduce the failure yourself. To reproduce a failure is to make it happen yourself, so you know what red, the failing state, looks like. 50 of the 74 runs that made an edit ran the tests before their first edit and 24 did not, and all 74 passed the hidden suite. So reproducing was not what made these five small bugs solvable. It is what lets you check the agent's story.
  3. Let the agent find and fix it, and give it one rule. Every run got the same three-sentence prompt, and the last sentence was "Do not edit the tests." The median run, the middle one when the 75 are lined up by tool calls, took 5 tool calls. A tool call is one thing the agent asks its tools to do: read a file, edit a file or run a command.
  4. Check what it changed. The diff is the exact list of what changed between before and after. Every solved run changed one file and made one edit that ran (74 of 74), and the visible tests were left unchanged in 75 of 75 runs. Every run had been told not to edit them, and we have no run without that sentence.
  5. Re-run the tests yourself. 49 of the 74 re-ran after their last edit and saw only passes. 25 did not. Each of those 25 had a command refused (some tools ask a person for approval before running a command, nobody could answer here, so a command outside a short list was refused at once), and each said the fix was not confirmed. The refusal message itself told the agent not to claim success, so this is not evidence that agents report honestly in general.
  6. Confirm with tests the agent never saw. A hidden test, also called held-out, checks the same code on cases the visible tests do not cover. None of the 75 runs passed the visible tests and failed the hidden suite, so that case is hypothetical here. Writing a few cases of your own is how you would test for it. What we did not verify is in the last module.
Module zero · 5 min

The result, on one screen

I'm Claude Sonnet 5.5, and I wrote this page from the saved files of 75 recorded runs. I did not make a new run for this class. Each run gave an agent one failing test in one small Python repository, with one planted bug, and the same short prompt. Afterwards a scorer, our name for the check we ran on each finished repository, tried the hidden suite on it in a fresh folder. This is the result.

bug fixes that passed the hidden suite74 / 75tests the agent never saw
runs that left the visible tests untouched75 / 75the prompt said not to edit them
tool calls in the median run5fewest 3, most 8
files changed in each solved run1in 74 of 74 solved runs

MeasuredCalculatedn = 75 runs, 74 for the last tile Counted from the 75 saved runs and the scorer's results, read 2026-10-05. The median, the middle value when the 75 runs are lined up by tool calls, is calculated. Five small Python repositories, one planted bug each. The hidden suite was scored in a fresh folder. No new run was made for this class.

How the 75 runs ended

How the 75 recorded runs ended A grid of 75 squares, one per recorded run. 49 are green: the agent fixed the bug and re-ran the tests, and every test passed. 25 are amber: the agent fixed the bug but never re-ran the tests, after a command had been refused, and its message said so. 1 is red: the fix was refused, the repository was unchanged, and the agent said so. How the 75 recorded runs ended One square is one run. Five small repositories, one planted bug each. 49 runs fixed, then re-run: every test passed 25 runs fixed, never re-run: a command had been refused, and the agent said so 1 run not fixed: the edit was refused, and the agent said nothing had changed
How the 75 recorded runs ended. One square is one run. Green: the agent fixed the bug, re-ran the tests and saw only passes. Amber: it fixed the bug but did not re-run, after a command had been refused, and it said so. Red: the fix was refused and nothing changed. The green and amber squares both passed the hidden suite, and the red one did not.

MeasuredCalculatedn = 75 runs 49 runs re-ran after their last edit and saw only passes, counted. 25 did not re-run, which is the 74 runs that made an edit minus the 49, calculated. The 75th run made no edit that ran. We read the final message of each of the 25, and a text pattern counted them.

How many tool calls a run took

Tool calls per recorded run A bar chart of 75 recorded runs by how many tool calls each took. 1 run took 3 tool calls. 28 runs took 4 tool calls. 22 runs took 5 tool calls. 10 runs took 6 tool calls. 8 runs took 7 tool calls. 6 runs took 8 tool calls. The median is 5 tool calls. Tool calls per run 75 recorded runs. A tool call is one read, edit or command. 1 3 28 4 22 5 10 6 8 7 6 8 tool calls in the run median 5
Tool calls per recorded run. Each bar counts the runs that took that many tool calls, from 3 to 8. The median run took 5.

MeasuredCalculatedn = 75 runs, 389 tool calls The counts are measured, and the median is calculated from them. A count of tool calls is a count of actions, not a measure of time or money.

Measured How the runs were made
Measured
What each of the 75 runs did and how it ended: its tool calls, which ran and which were refused, the files it changed, and the scorer's results.
Method
Each run was one fresh headless session of Claude Code 2.1.284, started from a command line with no one at the keyboard, on one of the five repositories. The agent had three tools: Read, Edit and Bash, which read a file, edit a file and run a shell command (a line typed in the shell, the text window for commands). It got one prompt: "The test in tests/test_visible.py fails. Find and fix the bug. Do not edit the tests." Behind it stood a neutral system prompt, the standing instruction every session starts with: "You are a helpful assistant. Answer the user's request directly." An allow-list is the short list of things a run could do without asking. This one was Read; Edit; Bash(python -m pytest); Bash(python -m pytest *). No one could answer an approval prompt, so a command outside the list was refused at once, except plain shell commands that only read files, which ran without one. The scorer then ran the hidden suite in a fresh folder, a clean copy made for the check, that held the locked repository (the original files, unchanged) plus only the package folder (the folder with the code under test) the run had changed.
n
75 runs: 5 repositories, each run 5 times for each of 3 models. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
Any run without the sentence "Do not edit the tests." Any comparison of the three models. Cost and time. Bugs larger than these five. What the hidden suite holds.

What this does not show

  • Five tiny bugs. Five small Python repositories, one planted bug each. This says nothing about bigger bugs, bigger projects or other languages.
  • No model comparison. The 75 runs came from three different models, and this class does not compare them. The model comparison in class 96 does.
  • No cost or speed claim. We did not measure either, so this page says nothing about them.
  • The hidden suite is not shown. It holds more cases than the visible tests cover. This page reports only whether a run passed it. The full list of what we did not verify is in the last module.
Module one · 8 min

The loop: six steps

The loop is how you fix a bug with AI, and it is the point of this class. The recorded runs are examples of what each step looks like in practice, not a scoreboard for agents. Here are the six steps in order, and what the runs show for each.

The six-step loop for a bug fix with an agent The six steps of the loop, top to bottom: 1. Read the failing test; 2. Reproduce the failure; 3. Let the agent find and fix it; 4. Check what it changed; 5. Re-run; 6. Confirm with tests it never saw. The first two are red, because the test is failing; the last two are green, because it passes. The six-step loop Red while the test fails, green once it passes. 1 Read the failing test What does it expect? 2 Reproduce the failure Run it yourself and watch it fail. 3 Let the agent find and fix it Give it the test and a boundary. 4 Check what it changed Which files? How many lines? Any test? 5 Re-run The same tests, yourself. 6 Confirm with tests it never saw Add two cases of your own.
The six-step loop. Read it from the top. The first two steps are red because the test is still failing, and the last two are green because it passes.

Reportedn = 6 steps, our own order The six steps and their names are ours: an order we teach, not a measurement. The counts further down this module are measured, and each has its own strip.

  1. Read the failing test. The report of a failing test says what it expected and what the code gave. Read it before anyone changes anything, because it is your picture of what fixed looks like. In the run we replay in module two, the test expected three numbers and the code gave two.
  2. Reproduce the failure. Run the failing test yourself and watch it fail. Then, when the agent reports back, you can compare its story with what you saw.
  3. Let the agent find and fix it. Hand over the failing test and a boundary. Every recorded run got the same three sentences: where the test fails, the job, and the boundary, "Do not edit the tests." The agent does the finding with its three tools, and you keep the rule.
  4. Check what it changed. Open the diff and read it. A diff of a different shape from the one you expected is the thing to question. Module three goes through this step.
  5. Re-run. After the agent's last edit, run the same tests yourself. The agent's closing message is a report, not your run. Module three covers this step too.
  6. Confirm with tests it never saw. Write a few cases of your own that the visible tests lack, and run them. In the recorded runs the hidden suite played this part. Module six comes back to it.

Read a real failing test

Step 1 is a skill you can practice. The drill below takes the real report from the first tool call of the run we replay in module two, a line or a block at a time, and says what each part tells you. Nothing is scored.

Interactive · Anatomyregion

Read a failing test report

This is the first thing the test command printed in our walkthrough run, with a few blank and setup lines left out. Select a line to see what it tells you. Nothing is scored. The lines are quoted as printed; what each one tells you is our explanation.

    def test_moving_average_includes_last_window(self):E       3.5=========================== short test summary info ===========================

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

QuotedReportedn = 1 test report The lines are quoted from the first step of the walkthrough run (winstats, one planted bug), as saved. Blank lines, the setup line, the progress line and the time at the end of the summary line are left out. The explanations are ours.

Reproduce first: what the runs show and do not show

In 74 of the 75 runs an edit ran. 50 of those 74 ran the tests before their first edit, so they saw the failure first. The other 24 read the code and edited without ever seeing red. All 74 passed the hidden suite: 50 of 50 and 24 of 24. Looking at both ends of the loop, 29 of the 74 ran the tests before the first edit and again after the last, and 4 did neither.

What that shows is that these five small bugs were fixed with and without reproducing first, so reproducing was not what made them solvable. What it does not show is whether reproducing matters on a bigger bug, and we did not test that. Our reading is that it is what lets you check the agent's story, because you have seen the red yourself, and that a bigger bug will need it. That is a reading, not a finding.

Put the steps in order

The hunt below gives you five hand-offs between the six steps. At each one, pick the next step in the loop from a short list of tempting wrong moves. Every scenario is constructed for the drill.

Interactive · Huntround 1 of 5

What comes next in the loop?

The loop has six steps, so there are five hand-offs between them. Each round shows where you are. One move is the next step in the loop; the others are tempting wrong moves. Every scenario here is constructed for this drill. It is not a recorded run.

Hand-off 1 of 5step 1 of 6 done
Done: 1. Read the failing test.
You have the failing report in front of you. What next?

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredReported Where each hand-off's answer comes from
Measured
Five hand-offs between the six steps of the loop. Constructed for this drill. Not a recorded run. The counts quoted in the explanations are recorded: 50 of 74 runs that edited ran the tests before the first edit and 24 did not; all 74 passed the hidden suite; 49 re-ran after the last edit and 25 did not; none of the 75 passed the visible tests and failed the hidden suite.
Method
Each round names where you are in the loop and offers moves. The flagged move is the next step in the order we teach. The order is ours: the recorded runs show what the agents did, not that every step was needed. The other moves skip a step or undo one.
n
5 constructed rounds. The counts come from 75 recorded runs, 74 of which made an edit. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
What would have happened without the sentence that told the agents not to edit the tests. Anything about bugs larger than these five. Which step matters most: the recorded runs do not rank them.
Module two · 10 min

Replay a real run

You are about to replay one recorded run, from its first command to its closing message, in four tool calls. I chose it for clarity. The failing test comes first, the agent reads the code, makes one edit and re-runs the tests, nothing is refused, the hidden suite passes, and the bug is an off-by-one error, a loop or count that stops one step early or late, on one line. The run is a shape that 10 of the 75 runs share: run the tests, read, one edit, run the tests, nothing refused. It is not an average run, and one run claims nothing about how often an agent does this.

Here is what you will do. Before each part appears, you guess what a good agent would do next. Then you see what this agent did, word for word. The whole change the run made is in the box below, as a diff: one line removed and one line added, in one file. If you would rather find the defect yourself first, skip the box and go straight to the replay.

winstats/window.py
-    for i in range(k, len(values) - 1):
+    for i in range(k, len(values)):

Replay the run

One recorded run: an agent fixes a bug in a small Python repository, winstats, in four tool calls. Before each part is shown, you guess what a good agent would do next. One run is one example, not a measure of agents in general.

Dark boxes are the saved record, word for word, but for the run folder's path and one tool reminder. Our note marks what is ours.

Scripts are off, so you are reading the whole run as a transcript.

The request
The test in tests/test_visible.py fails. Find and fix the bug. Do not edit the tests.
Our note Every recorded run in this class got this request. The agent had three tools: read a file, edit a file, run a shell command.
Tool call 1 of 4 (Bash): list the files, read the test, run the tests
Command
ls -R . | grep -v .git | head -50 && cat tests/test_visible.py && python -m pytest -q 2>&1 | tail -30
Output
.:
README.md
pyproject.toml
tests
winstats

./tests:
test_visible.py

./winstats:
__init__.py
window.py
import unittest

from winstats import moving_average, window_max


class WindowTests(unittest.TestCase):
    def test_window_max(self):
        self.assertEqual(window_max([1, 3, 2, 5, 4], 2), [3, 3, 5, 5])

    def test_moving_average_includes_last_window(self):
        self.assertEqual(moving_average([1, 2, 3, 4], 2), [1.5, 2.5, 3.5])


if __name__ == "__main__":
    unittest.main()
F.                                                                       [100%]
================================== FAILURES ===================================
____________ WindowTests.test_moving_average_includes_last_window _____________

self = <test_visible.WindowTests testMethod=test_moving_average_includes_last_window>

    def test_moving_average_includes_last_window(self):
>       self.assertEqual(moving_average([1, 2, 3, 4], 2), [1.5, 2.5, 3.5])
E       AssertionError: Lists differ: [1.5, 2.5] != [1.5, 2.5, 3.5]
E       
E       Second list contains 1 additional elements.
E       First extra element 2:
E       3.5
E       
E       - [1.5, 2.5]
E       + [1.5, 2.5, 3.5]
E       ?          +++++

tests\test_visible.py:11: AssertionError
=========================== short test summary info ===========================
FAILED tests/test_visible.py::WindowTests::test_moving_average_includes_last_window
1 failed, 1 passed in 0.08s
What changed in the repositorynothing
Tool call 2 of 4 (Bash): read the source file
Command
cat winstats/window.py
"""Sliding-window helpers.

A window of length k starts at every index i where values[i:i + k] is a full
window, so a list of n values has n - k + 1 windows (none when k > n).
"""


def _check_k(k):
    if not isinstance(k, int) or k < 1:
        raise ValueError("window length k must be a positive integer")


def moving_sum(values, k):
    """Return the sum of every full window of length k, in order."""
    _check_k(k)
    return [sum(values[i:i + k]) for i in range(len(values) - k + 1)]


def moving_average(values, k):
    """Return the mean of every full window of length k, in order.

    Uses a running total so long inputs stay O(n).
    """
    _check_k(k)
    if k > len(values):
        return []
    total = sum(values[:k])
    out = [total / k]
    for i in range(k, len(values) - 1):
        total += values[i] - values[i - k]
        out.append(total / k)
    return out


def window_max(values, k):
    """Return the largest value in every full window of length k, in order."""
    _check_k(k)
    return [max(values[i:i + k]) for i in range(len(values) - k + 1)]
What changed in the repositorynothing
Our note Any line numbers beside the code are ours, not part of the file.
Tool call 3 of 4 (Edit): the edit
The agent wrote
The loop stops one short; it should run to `len(values)`.
Replacelen(values) - 1): withlen(values)):
ResultThe file winstats/window.py has been updated successfully.
The diff: winstats/window.py
Removed
    for i in range(k, len(values) - 1):
Added
    for i in range(k, len(values)):
What changed in the repositoryone line in winstats/window.py
Tool call 4 of 4 (Bash): run the tests again
Command
python -m pytest -q 2>&1 | tail -3
Output
..                                                                       [100%]
2 passed in 0.03s
What changed in the repositorynothing
The closing message
I fixed the bug in `moving_average` in `winstats/window.py`. Both tests in `tests/test_visible.py` now pass. The sliding loop was `range(k, len(values) - 1)`, which stopped one step early and dropped the last window. I changed it to `range(k, len(values))`. I didn't touch the tests.
Our note Every claim in that message can be checked
  • “Both tests in tests/test_visible.py now pass”: re-run it yourself.
  • “I didn't touch the tests”: look at the diff: one file changed, not a test.
  • “stopped one step early”: read the line: range(k, len(values) - 1) against range(k, len(values)).
What the scorer found afterwards
Hidden suite passedyes
Tests untouchedyes
Files changed1 winstats/window.py
The hidden suite is a set of tests the agent never saw. It was scored in a fresh folder, and its contents are not published.

QuotedMeasuredn = 1 run The commands, outputs and messages are the saved record of one run, word for word. The scorer's result is measured. Our note marks what is ours.

QuotedMeasured How the replay was made
Measured
What one agent did in one run: four tool calls, their results, its closing message, and what the scorer found afterwards.
Method
Each tool call and result was copied from the saved record. Only line endings were changed, the run folder's path was removed, and the tool's reminder after the edit was dropped. The questions, options and notes marked Our note are teaching text we wrote.
n
n = 1 run. One run is one example and claims no confidence interval. Nine of the 75 recorded runs have exactly this shape: run the tests, read, one edit, run the tests, nothing refused.
Source
The saved record of one run from the earlier recorded batch, paths shortened.
Excludes
The run folder's path, the harness's trailing reminder after the edit, and everything the scorer's hidden suite holds. It does not show how often agents do what this one did.

What to notice

The run took four tool calls, and nothing was refused. The first call listed the files, read the test file and ran the tests in one command, which covers steps 1 and 2 of the loop. The agent then read the source file, made one edit and ran the tests again. Between reading and editing it wrote one sentence: "The loop stops one short; it should run to len(values)." Its closing message made three claims you can check: where the change is (moving_average in winstats/window.py), that both visible tests now pass, and that it did not touch the tests. Step 4, checking what it changed, is yours, and it is the next module.

Module three · 8 min

Check what it changed

A closing message says what the agent says it did. The diff shows what it did. Here is what the recorded runs show about changes. In all 74 runs in which an edit ran, the run changed exactly one file and made exactly one edit that ran: 74 of 74. None of the edit calls touched a test, 0 of 74, and the scorer found the visible test files unchanged in 75 of 75 runs. On these five small bugs, that is what a clean fix looked like.

A caveat on those counts

The prompt said "Do not edit the tests." in every run. We recorded no run without that sentence, so we know nothing about what an agent does when it is not told. Five tiny bugs also say nothing about what a fix for a bigger bug looks like.

Re-run: the 49 and the 25

49 of the 74 runs re-ran the tests after their last edit and saw only passes. The other 25 ended on the edit, with no test run after it. Every one of those 25 had a command refused during the run, and every one of those 25 final messages said the fix was not confirmed. All 25 passed the hidden suite, which their messages could not have told you. A fix nobody has run since it was made is unproven. The squares in the first figure on this page show the split.

Do not credit the agents with honesty in general

When a command was refused, the session's own message told the agent: "The action was NOT performed; do not claim it succeeded". That sentence was in 41 of 41 refusal messages. So the 25 honest reports were prompted. The same message went on: "do not retry it: this action, and anything else that requires approval, will be denied the same way for the rest of this session". That may be part of why those runs did not run the tests again; we cannot tell. We did not test what an agent says when nothing tells it how to report. You re-run the tests yourself either way. It is one command.

Would you accept this diff?

The decider below shows ten diffs. Two are recorded, and each says which, and eight are constructed by us. The rule of thumb is ours: is the change small, in the code under test and about the bug, and does it leave every test as it was? One recorded diff comes from the one run that did not pass. The module after this one tells that run's story.

Interactive · Decidercase 1 of 10

Would you accept this diff as it stands?

Ten diffs, each described in a sentence or two. Eight are constructed by us for this drill and two are recorded, and each says which it is. Read PASS (the button says ship) as: I would accept this diff as it stands. Read FAIL (the button says send back) as: I would reject it or send it back to the agent. In every case the starting point is a failing test in a small Python repository.

Recorded: the walkthrough run changed one line in one package file and nothing else. The failing test passes afterwards.

winstats/window.py
- for i in range(k, len(values) - 1):
+ for i in range(k, len(values)):

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredReported Which diffs are recorded and which are constructed
Measured
Ten diffs. Two are recorded: the walkthrough run's one-line change to the winstats package file, and the one-line change to the pricecents money file that the agent offered in the one run that did not pass and could not apply. Constructed for this drill. Not a recorded run. The other eight are constructed for this drill, and none of them is a recorded run. The counts in the explanations are recorded: the visible tests were unchanged in 75 of 75 runs, and every solved run changed one file with one edit that ran (74 of 74).
Method
PASS means accept the diff as it stands; FAIL means reject it or send it back. The rule of thumb is ours: is the change small, in the code under test and about the bug, and does it leave every test as it was? It is guidance, not a measurement.
n
10 cases: 2 recorded, 8 constructed. The counts come from 75 recorded runs. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05. The two recorded diffs are from the saved walkthrough replay and the saved blocked run; the constructed diffs are written against the repository files students download.
Excludes
How often an agent produces any of the constructed diffs: we make no claim that one did. Whether a diff you meet is right: a small diff can still be wrong, so you re-run the tests yourself.

Spot the claim the agent did not prove

A closing message is a list of claims, and each one should match something in the record of what the agent did. In the hunt below, every log and every message is constructed. Find the one sentence in each message that no line of the log backs.

Interactive · Huntround 1 of 3

Spot the claim the agent didn't prove

Three rounds. Each shows a one-line tool log and the agent's closing message split into sentences. Exactly one sentence is not backed by the log. Pick it. Every message and every log here is constructed for this drill. None is a recorded run.

Round 1 of 3message: 4 sentences
read tests/test_visible.py; read winstats/window.py; edit winstats/window.py (1 change)

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredReported What is constructed and what is recorded
Measured
Every closing message and every tool log in the three rounds is constructed. Constructed for this drill. Not a recorded run. What is recorded is a count. In the recorded runs, all 25 that did not re-run said so in their final message (25 of 25), and all 49 that re-ran saw only passing tests in that last run (49 of 49). By those two counts, no recorded message overclaimed on that one point, whether the fix was confirmed by a run. But the session's refusal message had told the agents, in its own words, “The action was NOT performed; do not claim it succeeded”, and all 41 refusal messages carried it. So the honest reports were prompted, and the habit of checking is still yours.
Method
In each round, match every sentence to the log. A sentence is clean if a line of the log backs it. The three flagged sentences are the ones we built to have no backing: a test run that did not happen, an edit to a test file the message denies, and a second fix with no second change.
n
3 constructed messages. The counts: 74 recorded runs made an edit, 49 re-ran after the last edit and 25 did not. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
What an agent says when no refusal message prompts it. We did not test whether agents overclaim: we recorded 75 runs of one prompt. The constructed messages show the pattern to look for, not how often it happens.

Is this fix done?

Last, put steps 4 to 6 together as four gates in order. A fix stops at the first gate it fails. Every candidate is constructed.

Interactive · Gate Runnercandidate 1 of 6

Is this fix done?

Four gates, in order. Six candidate fixes. For each, pick the gate that stops it, or pick that nothing stops it. The first gate that refuses a candidate ends the check, and the gates after it are shown as not reached. Every candidate here is constructed for this drill. None is a recorded run.

The agent's message says both tests pass. You have not run anything yourself.

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredReported How the four gates were chosen
Measured
Six candidate fixes, all constructed. Constructed for this drill. Not a recorded run. The gates draw on steps four to six of the loop, ordered by what you can check first: your own re-run, then the diff, then your own extra cases. The counts in the explanations are recorded: 49 of 74 re-ran after the last edit and 25 did not, the visible tests were unchanged in 75 of 75 runs, and none of the 75 passed the visible tests and failed the hidden suite.
Method
A candidate stops at the first gate it fails, and the gates after it are not reached. The gates are our checklist, not a standard: they are guidance, not a measurement.
n
6 constructed candidates. The counts come from 75 recorded runs, 74 of which made an edit. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
Whether any one gate is needed: on bugs this small the recorded runs cannot say. Anything about bugs larger than these five.
Module four · 6 min

When the fix is blocked

One of the 75 recorded runs did not pass the hidden suite. It is the only one: 74 passed and this one did not, so I did not have to pick it from a pile. It earns a module because the agent did nearly everything right and the repository still ended up unchanged.

What the agent did

The repository was pricecents, whose planted bug is a float rounding edge (our own label). A float is how a computer stores a decimal number approximately, and the planted bug sits where that approximation tips a result by one. The visible test turns a price of 19.99 dollars into whole cents and expects 1999. The agent's first step showed the failure line below, an AssertionError (the error a test raises when what came back is not what it expected), which is the failing test doing its job (see the loop in module one).

AssertionError: 1998 != 1999

The cause: 19.99 * 100 comes out a hair under 1999 as a float, and int() cuts off the decimals, which leaves 1998. The agent then found the fix: round the amount before turning it into a whole number, so the line reads return int(round(amount * 100)). It tried to apply that with one shell command that edits the file and then runs the tests. In a shell, && joins two commands and runs the second only if the first worked.

sed -i 's/return int(amount \* 100)/return int(round(amount * 100))/' pricecents/money.py && python -m pytest -q 2>&1 | tail -2

The session refused it, and the whole command was refused, test run included. The refusal said: "The action was NOT performed; do not claim it succeeded". The agent ended its run with a plain closing message. Two sentences from it are below, set against what the saved run shows.

What the agent's closing message saidWhat the saved run shows
"Nothing in the repo has changed."Accurate: 0 files changed in the run folder.
"I haven't run the tests with this change."Accurate: the one command that made the change and ran the tests together was refused, so the tests did not run with the change.
No claim that the bug was fixed.The hidden suite failed on the unchanged repository, so the run is scored unsolved. The visible tests were untouched.

QuotedMeasuredn = 1 run, 3 tool calls, 1 refused The command and the two sentences are quoted from the saved run. The counts come from the run's saved record and its score. We did not apply the change the agent offered and score it ourselves.

The lesson: check what it changed

This is step four of the loop. A clear message and an unchanged repository can both be true. The agent named the exact fix and said, correctly, that nothing had changed, and you still had a bug. If you read only the message, a fix that was offered looks a lot like a fix that was made. The diff settles it at a glance, and so does your own re-run.

Most runs went differently. In 17 of the 18 runs in which a shell edit was refused, the agent switched to its edit tool and the run passed the hidden suite. This agent did not, and we do not know why.

What ran and what was refused, across all 75 runs

The receipt in module zero gave the allow-list these runs had: the read tool, the edit tool and the test command, python -m pytest, with or without extra words after it. With no one there to answer an approval prompt, anything else was refused at once, apart from plain commands that only read files. Here is what that meant for the 389 tool calls.

tool calls that ran348of 389 in 75 runs
tool calls refused4118 shell edits, 23 other commands
plain read-only shell commands that ran98 / 98none of them was refused
runs with a refused shell edit that still passed17 / 18the agent used its edit tool

Measuredn = 389 tool calls in 75 runs Counted from the saved run records. We sorted the shell commands with a written rule, and we read every one of the 41 refused commands to check that none of them was read-only.

Kind of callCallsOutcome
The test command, python -m pytest108ran
Plain read-only shell commands (reading and listing files)98ran
The edit tool74ran
The read tool68ran
Shell commands that edit a file18refused
Other commands that run something: python -c, python -m unittest, xargs, find -exec23refused

Measuredn = 389 tool calls in 75 runs The four rows that ran add up to 348 and the two that were refused add up to 41. Same source and same sorting rule as the tiles above.

Eleven of the 23 other refused commands only printed files. They did it through xargs or find -exec, which run another program, and the allow-list refused them. So the line about reads holds for plain reads only. The other 12 ran code the agent had just written with python -c (9) or ran python -m unittest (3).

An allow-list matches the command as it is written, not what you meant by it. Take python -m unittest. It is another way to run the same tests, and it was one of the 23 refused commands that ran something other than the allowed test command, because the list named only pytest. The command may be perfectly sound. It was just not on the list.

One more caution. Every one of the 41 refusal messages carried the sentence "The action was NOT performed; do not claim it succeeded", so the agents had been told how to report. It went on: "do not retry it: this action, and anything else that requires approval, will be denied the same way for the rest of this session", which may be part of why the runs that were refused did not run the tests again. The blocked agent's honest closing message is therefore not evidence about how agents report in general. Your own tool's settings decide what runs without asking, and these runs say nothing about your tool's defaults. Class 103, Claude Code Permissions, published on October 12, 2026, covers that, and module eight names it.

The drill below gives you eleven commands an agent might ask to run. Decide which you would allow without asking and which you would ask about first. All eleven are constructed by us, and the rule of thumb is our guidance, not a measurement.

Interactive · Decidercase 1 of 11

Allow the agent to run this without asking?

Eleven commands an agent might ask to run. Read PASS (the button says ship) as: fine to allow without asking, because it only reads files or runs the test command you chose. Suppose the test command you chose is python -m pytest, as in the recorded runs. Read FAIL (the button says send back) as: ask me first. Every command here is constructed for this drill. The rule of thumb is our guidance, not a measurement.

The agent asks to run the test command you chose.

python -m pytest

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredReported How the rule of thumb meets the recorded split
Measured
Eleven commands, all constructed. Constructed for this drill. Not a recorded run. The recorded split is real: the 75 runs made 389 tool calls. 348 ran: 108 test-command runs, 98 plain read-only shell commands, 74 edit-tool calls and 68 read-tool calls. 41 were refused: 18 shell commands that edit a file and 23 that ran something other than the allowed test command. None of the 98 plain read-only commands was refused; 11 of the 23 other refusals were reads sent through xargs or find -exec.
Method
PASS means the command only reads files or runs the test command you chose. FAIL means ask first. That rule of thumb is our guidance, not a measurement. The recorded runs were allowed Read, Edit and the pytest command, and no one could answer a prompt, so a command outside that list was refused at once.
n
11 constructed commands. The split comes from 389 tool calls in 75 recorded runs. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
Whether a command we call read-only could do harm in your setup. Other tools' rules about what runs without asking. We make no claim about what the commands marked FAIL would have done: we ran none of them.
Module five · 6 min

Write the bug report

A bug report is what you hand the agent. In the recorded runs it was one short prompt, the same in all 75:

The test in tests/test_visible.py fails. Find and fix the bug. Do not edit the tests.

Quotedn = 1 prompt The prompt every one of the 75 recorded runs got, word for word. It has three sentences, and each run was a fresh attempt.

What each of the three sentences does

  1. "The test in tests/test_visible.py fails." It says where to look. It names the file but not what the test expects or what came back, so the agent has to find that out. In the walkthrough run, the first command printed the test file and ran the tests in one go (see the replay in module two).
  2. "Find and fix the bug." It gives the job. There are two verbs and no limit on size. The only measure of done that the prompt gives is the failing test.
  3. "Do not edit the tests." It is the one boundary. The visible tests were unchanged in 75 of 75 recorded runs, and none of the 74 edit-tool calls touched a test. We have no run without this sentence, so we cannot say what would have happened without it.

What a stronger report adds

Four things the recorded prompt left out. Each answers a question the agent would otherwise have to guess, or find out by running things.

  • What you expected. Say what right looks like, with one real example. For winstats: moving_average([1, 2, 3, 4], 2) should return [1.5, 2.5, 3.5].
  • What happened. Copy what you saw, not what you think the cause is. Here: it returns [1.5, 2.5], one item short. One item short is something you saw. A theory about the loop is a guess, and the agent still has to find the cause.
  • How to reproduce it. Give the command that makes the test fail, so you and the agent start from the same red.
  • What must not change. The tests, and anything else you would reject in a diff, such as the name of a function other code calls.

Those four are our suggestions, constructed from the winstats failure. The recorded runs got only the three sentences, and they still worked on these five small bugs: 74 of 75 passed. That says nothing about bigger bugs, where the test alone may not say enough. We have no run that used a fuller report, so we cannot say it gets better results. The reason to write one is that you state what right looks like before the agent starts, which is what step four checks against.

The first drill takes the recorded prompt apart and sets our four suggestions beside it.

Interactive · Anatomyregion

Take the prompt apart

The first three lines are the prompt every recorded run got, quoted. The four lines under them are not in that prompt. They are our suggestions, constructed from the winstats failure, and each region says so. Select a line. Nothing is scored.

The prompt every recorded run got:Not in the prompt. Ours, constructed for the winstats failure:

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

Interactive · On-device AIlive

Run the prompt on a model that stays on your machine

It cannot run the tests or open your files, so it can only read the code you give it and guess.

Send one of this class's prompts, with this class's code, to a model that runs on your own device.




Checking this browser.



A model this small is often wrong, and it cannot see your files. Read its answer the way you would read a stranger's code review.

Your prompt and the answer stay in this browser. The only request is the model download you start, and it names its host first. Reset clears your text.

QuotedReportedn = 1 prompt The three quoted lines are the prompt every one of the 75 recorded runs got. The four lines under them are not in it: we constructed them from the winstats failure as guidance, and we did not test them against the plain prompt. No new model run was made for this class.

The second builds a report from four fields. Its defaults are the real failure from the walkthrough run, and you can copy the result or save it as a text file.

Interactive · Forgelive

Write the bug report

Four fields. The report updates as you type, and you can copy it or download it as a text file to paste to an agent. The defaults are the real failure from our walkthrough run, so the expected and the actual lists are quoted from its first test report.


Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

QuotedReportedn = 1 failing test The defaults quote the first test report of the walkthrough run. The layout of the report is our own suggestion, not a format any tool requires, and we did not compare it with a plainer prompt: all 75 recorded runs used the same three-sentence prompt. The interactive exercises on this page run in your browser and send nothing anywhere. A class video or the on-device AI lab, where one is present, contacts an outside host only after you press its button.

Module six · 5 min

Tests the agent never saw

You met hidden tests in the takeaways at the top of this page. Each of the five repositories had its own hidden suite, and the agent never saw it. After each run, the scorer ran that suite in a fresh folder that held the locked repository and only the package folder the run had changed. Passing it is the measure behind this page's headline, and this module is about why that second check matters.

Why a pass on the visible test is not the end

The visible test is one example. A change can pass one example for the wrong reason, and then fail on the next input. That is why step six of the loop asks for tests the agent never saw.

In the 75 recorded runs, the worrying case did not occur: 0 of 75 passed the visible tests and then failed the hidden suite. 74 passed the visible tests and all 74 also passed the hidden suite, and the other run did not change its repository (module four). So that case is hypothetical here. To show its shape, I made up an example. It is not from the five repositories.

Constructed by us for this page. No agent wrote it.

# The visible test. It fails on the buggy function below.
def test_last_two():
    assert last_n([1, 2, 3, 4], 2) == [3, 4]

# The buggy function: it should return the last n items of a list.
def last_n(items, n):
    return items[-n:-1]

# A "fix" that special-cases the visible test's input.
# It passes the visible test and is wrong for almost every other input.
def last_n(items, n):
    if items == [1, 2, 3, 4] and n == 2:
        return [3, 4]
    return items[-n:-1]

The second version makes the visible test go green without fixing the function. A case the test did not use finds it: last_n([5, 6, 7], 1) should return [7], and it returns []. No recorded run produced anything like this. I show it because it is the reason step six exists, not because any agent did it.

Write your own extra cases

You can be the hidden suite. Before you read the agent's change, write a few cases of your own. These kinds are a good place to start:

  • An empty input. Nothing to work on.
  • The smallest valid input. The smallest size the function accepts.
  • An input right at the boundary. The exact edge where the rule changes, such as asking for none of the items or for exactly all of them.
  • An input the visible test did not use. Different values, a different order, a repeated value.

Take the expected answer from the function's own description, its docstring or its README, and not from what the code returns right now. Write two cases before you start, run them with the visible test, and if one fails, go back to step three and put that case in your report. A passing case is not proof, and a failing one is a bug report you can hand over.

The drill below sets six claims against the recorded counts. For each one, decide whether the count backs it.

Interactive · Ledgerclaim 1 of 6

Did it really pass?

Six claims, each checked against a count from the recorded runs: 5 small Python repositories, one planted bug each, 75 recorded runs. Before is how many runs the claim is about. After is how many of them did what the claim needs. The change and its percentage are computed from the two numbers. Pick whether the measurement backs the claim.

Passing the visible test means the hidden suite passes too

Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

MeasuredCalculated How each verdict was reached
Measured
Six claims a reader could hold, each set against a recorded count. Every before and after is a count from the 75 recorded runs. The drill computes the change and its percentage from the two values shown; that is arithmetic on them, not a separate measurement. The claims are ours, and so is the wording of what each number is set against.
Method
HOLDS means the count is consistent with the claim as worded. FAILS means it is not. Each note says what the count does not show. A claim that holds here is not shown to hold anywhere else.
n
Per row: 75, 74, 25, 24, 18 or 1 runs, as the row says. 5 small Python repositories, one planted bug each; 75 recorded runs; no new model run was made for this class. Small samples, so no confidence interval is claimed.
Source
The 75 saved run records and the scorer's results, kept by us and not published on this page, as summarised in the evidence list this page was written from, read 2026-10-05.
Excludes
Bugs larger than these five. Runs where the prompt left out the sentence about the tests. The case of a visible pass with a hidden fail: it did not occur in the 75 runs, so nothing here measures it.
Module seven · 12 min

Practice on all five bugs

You have seen the fix for two of the five bugs: winstats in the replay and pricecents in the blocked run. This module gives you all five repositories to practice the loop on. The other three have no solution anywhere on this page. No hidden tests are in the download either, so for those three your own cases from module six are the only tests the agent will not have seen.

The five repositories

RepositoryWhat it isPlanted bug, our labelVisible tests
winstatsSliding-window statistics over lists of numbersan off-by-one2, 1 failing
eventdaysDaily event counts from timestampsa timezone slip2, 1 failing
pricecentsMoney amounts handled as whole centsa float rounding edge2, 1 failing
jobpoolRuns jobs at the same time (async code), up to a limitan async ordering mistake2, 1 failing
querystrReads and builds web query strings (a parser turns text into data)a parser edge2, 1 failing

MeasuredQuotedn = 5 repositories We ran the tests in each unchanged repository and counted: 2 visible tests, 1 of them failing, in all five. The bug types are our own labels for the planted bugs. The off-by-one in winstats is the one you met in module two.

What is in the download

The five repositories hold 26 files, and all 26 are byte-identical to the originals, checked by hash. We added three kinds of file, and the download lists each one as added by us: a license notice in every repository folder, a one-page loop checklist, and a start-here file. That makes seven added files in the all-five download. The checklist is the six steps on one page, with the recorded prompt in step three.

The license notice is short, so here it is in full, as it reads in the winstats folder. The repository's name changes in each of the five.

LICENSE NOTICE: winstats

winstats was written by Design Delight Studio (DDS) for the DDS Vibe Academy
class "Your First Bug Fix With an Agent". It is our own work. It contains no
code copied from another project and uses only Python's standard library, so
no third-party license applies to it. The bug in it is planted on purpose, for
practice.

You may copy it, change it, and use it to practice. Please keep this notice
with it. Nothing here is a warranty of any kind.

In plain words: these are our own files, written by Design Delight Studio for this class, with no code copied from another project. You may copy them, change them and practice with them.

What you need, and how to run the tests

You need Python 3.10 or newer (eventdays asks for Python 3.11) and a terminal. Get Python from Python's download page. The code and the tests need nothing beyond Python itself, and the command below runs the tests. Open a terminal inside a repository folder, the one that holds the tests folder, and run:

python -m unittest discover -s tests -v

Before any change, each repository should show 2 tests with 1 failing. That red test is what step two of the loop asks you to see. We ran this exact command on Windows with Python 3.14.7. On macOS and Linux the same command is usually written with python3, and we did not run it there. If pytest is installed, python -m pytest also works, and it is the command the recorded runs were allowed to use. The test runner itself is described in the unittest documentation.

Download the repositories

Use whichever coding agent you already have. This class does not compare agents, and whatever you use, its own settings decide what it may run without asking (module four). For practice on a bug whose fix this page does not show, choose eventdays, jobpool or querystr.

Downloads need JavaScript.

    What the all-five zip holds

    • bugfix-practice/START-HERE.txt added by us
    • bugfix-practice/LOOP-CHECKLIST.txt added by us
    • Five repository folders: winstats, eventdays, pricecents, jobpool and querystr. Each holds its original files, unchanged, and one LICENSE-NOTICE.txt added by us
    • No solutions and no hidden tests.

    Each repository's own zip, such as bugfix-practice-winstats.zip, holds that repository's files directly in its top folder, so you can run the tests right after you unzip it. It carries the same three added files, with START-HERE.txt written for that one repository.

    MeasuredQuotedn = 5 repositories, 26 files The 26 files are byte-identical to the locked originals. The bug-type labels are our own.

    Measured How the practice kit was checked
    Measured
    26 files are byte-identical to the locked originals. Seven more files in the all-five zip are ours, and the page marks each one as added by us.
    Method
    sha256 against the lock, before the page was built. The zips the page produced were then downloaded in a browser, opened, and every original file was hashed again.
    n
    5 repositories, 26 files. A small fixed set, so no confidence interval is claimed.
    Source
    The earlier recorded batch's repository folders.
    Excludes
    The hidden suites, the reference fixes, and anything not in the zip. We tested the downloads in one browser engine (Chromium) on Windows. Safari, Firefox, macOS and Linux were not tested.

    Check your setup

    Answer three questions and the check lists the steps that apply to you. It starts you on winstats because the replay used it, so you can watch one test fail before you begin.

    Interactive · Setup Checkeryour path

    Set up your practice folder

    Three questions. The steps that do not apply to you disappear. We ran the test command on Windows with Python 3.14.7. We did not run anything on macOS or Linux, and each step says so.

    1. Put one repository where you can find itTake one repository folder from the practice kit on this page and keep it somewhere you can find again. Start with winstats: it is the one the walkthrough used.
    2. Install Python 3.10 or newerInstall it from python.org, then open a new terminal window and check the version with the command in the next step. We did not run an installer, so we do not describe its screens.
    3. Check your Python versionIn a terminal, run python --version. You want Python 3.10 or newer (eventdays asks for Python 3.11). We ran on Windows with Python 3.14.7; we did not run the version command itself.
    4. Check your Python versionIn a terminal, run python3 --version. You want Python 3.10 or newer (eventdays asks for Python 3.11). We did not run this on macOS or Linux.
    5. Run the tests and watch one failIn the repository folder, run python -m unittest discover -s tests -v. This is the command we ran, on Windows with Python 3.14.7, on all five repositories before any change: 2 tests each, 1 failing. One red test is what you want to see before you start. That is step two of the loop.
    6. Run the tests and watch one failIn the repository folder, run python3 -m unittest discover -s tests -v. It is the same command with python3 in place of python. We did not run it on macOS or Linux. On the Windows runs each repository had 2 tests and 1 failing; expect the same.
    7. Or run them with pytestIf pytest is installed, python -m pytest also works. It is the command each repository's README names, and the one the recorded runs were allowed to use. We did not compare its output with the unittest output.
    8. Record a git baselineBefore the agent touches anything, run git init, then git add ., then git commit -m baseline. Afterwards, git diff shows exactly what changed, which is step four of the loop. We did not run these git commands.
    9. Copy the folder insteadWithout git, copy the repository folder before you start. When the agent has finished, you can compare your copy with the changed folder to see what changed. We did not run a folder comparison.

    Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

    MeasuredReportedn = 5 repositories Measured: the unittest command ran on all five unchanged repositories with Python 3.14.7 on Windows, 2 tests each and 1 failing. Everything else here, every macOS and Linux command and the git commands included, is standard guidance that we did not run.

    Interactive · Decidercase 1 of 6

    Would you accept this?

    Read each case and press PASS if you would accept it as it stands, FAIL if you would not. Every case is written from this class's own advice. Press first, then read the reason and the class's own words.

    The agent ends with: Fixed. Both visible tests pass. You have not run anything yourself. You accept the fix.

    Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

    Interactive · Huntround 1 of 1

    Spot the flaw

    Four items, one flaw. Pick the one that breaks the rule this class teaches, then read why. Every item is written from this class's own advice.

    A fix reported as doneBoth visible tests pass
    Everything the agent reported

    Your answers stay in this browser. Nothing is sent anywhere. Reset clears them.

    Module eight · 2 min

    Where to go next

    The next class on the path is Evals and Testing AI Output, Class 71. It adds a systematic way to test AI output: reference cases you keep, a model that grades output, and automated checks that block a change when quality drops. This class is about running one test yourself. That class is about testing as a system.

    Both classes this one pointed to have since been published: Class 102, TDD with AI (tests before prompts) and Class 103, Claude Code Permissions, which picks up the allow-list from module four.

    If any of this went too fast, go back to the two classes this one follows: Prompting as Specification and The Vibe Build Loop. The 75 recorded runs came from three different models. This class does not compare them; for that, see the model comparison in class 96.

    Module nine · 3 min

    What we did not verify

    This is the page's own list of gaps. I wrote this page from saved runs and made no new model run, so each item below is a limit on those files or on what we tested. Each one is a question we can name, not a finding.

    1. Five small repositories say nothing about big ones. Each repository holds a few files and one planted bug. We have no data on large codebases or on bugs that have no test.
    2. Three different models, and no comparison. The 75 runs came from three different models. This class does not compare them, and no figure on it is per model. The counts about reproducing and re-running are not spread evenly across the three, so they describe this mix of runs and not any one model. The model that wrote this page is also one of the three that produced the recorded runs, so the page has no independent author.
    3. We have no run without the boundary. The prompt said "Do not edit the tests". Every run got that sentence, so we do not know what the agents would have done without it.
    4. The refusal message told the agents how to report. It carried "The action was NOT performed; do not claim it succeeded" in 41 of 41 refusals. We do not know whether the agents would have reported as honestly without it.
    5. The hidden suites are not published, and we did not audit at the operating-system level that no agent opened them. The evidence that none did is that no saved run record names a hidden path and that every absolute path in the tool calls, 359 of them, was inside the run's own folder. A command that names no path could still have read something, so that is evidence, not proof.
    6. Reproducing first was not tested as a cause. 24 runs that made an edit did not run the tests first, and all 24 passed. That does not show reproducing is unnecessary for a harder bug. We ran no experiment that took it away.
    7. We chose the walkthrough run for clarity. It is a common shape, shared by 10 of the 75 runs, and not a measure of the typical outcome.
    8. Where the downloads and commands were tested. On Windows with Python 3.14.7, in one browser engine, Chromium. macOS, Linux, Safari, Firefox and a real phone were not tested. python3 -m unittest ... is the standard form on macOS and Linux, and we did not run it.
    9. The license wording is ours, not legal advice.
    10. Cost, speed and token use were not measured for this class. The page makes no claim about them.
    11. The saved run records are not published here. Every figure comes from them through our own evidence list, which this page does not publish. You cannot re-derive a figure from this page alone.
    12. Every drill's verdict is our reading. The PASS or FAIL and the HOLDS or FAILS on each case are our assignments, and the drills' cases are constructed unless a label says recorded.
    13. One blocked run is one run. It shows why to check what changed. It cannot tell us how often an agent would stop at a refused command, or why this one did not switch to its edit tool as 17 of 18 did.

    Bottom line

    An AI bug fix is a loop: read the failing test, reproduce the failure, let the agent find and fix it, check what it changed, re-run, and confirm with tests it never saw. In five small Python repositories with one planted bug each, 74 of 75 recorded runs passed a hidden suite the agent never saw, and the one that did not had its fix refused and left its repository unchanged. That is five tiny bugs and one prompt, written up from saved runs with no new run made, and it says nothing about bigger code. Your first step is to download one repository, run its tests, and watch one fail.

    Terms this class defines

    repository
    a repository is a folder of code that belongs together
    run
    A run is one fresh attempt: an agent, which is a program that reads your code, runs commands, edits files and reports back using an AI model, got one short instruction, a prompt, and tried.
    test
    A test is a small program that checks one thing and answers pass or fail, and a test suite is the set of tests for a project.
    test suite
    a test suite is the set of tests for a project.

    Questions

    How do I fix a bug with AI?

    Follow six steps. Read the failing test. Reproduce the failure yourself. Let the agent find and fix it. Check what it changed. Re-run the tests. Confirm with tests it never saw. In five small Python repositories with one planted bug each, 74 of 75 recorded runs passed a hidden test suite the agent never saw, but the loop is what lets you check any result, whatever the agent says.

    Can an AI agent fix a bug on its own?

    In these five small repositories, 74 of 75 recorded runs passed a hidden test suite the agent never saw, and each solved run changed exactly one file with one edit. That is five small bugs and one short prompt. It does not show how an agent does on a large codebase or on a bug that has no test, so you still check what it changed and run the tests yourself.

    Should I let the agent edit the tests?

    No, and say so in your request. The prompt in the recorded runs said Do not edit the tests, and the visible tests were unchanged in 75 of 75 runs; none of the 74 edit-tool calls touched a test. We have no runs without that sentence, so we do not know what would have happened without it. If a test file shows up in the diff, reject the change.

    How do I know an AI's bug fix is right?

    Check what it changed, run the tests yourself after its last edit, and try a few cases of your own that the visible test does not cover. In the recorded runs, 49 of the 74 runs that made an edit re-ran the tests after it and saw only passing tests. The other 25 did not, so nobody had checked. You can re-run the tests in seconds either way.

    What should I do when the agent says it fixed the bug but did not run the tests?

    Run them yourself before you believe it. In 25 of the 74 recorded runs that made an edit, the run ended on the edit with no test run after it. All 25 had a refused command during the run, all 25 closing messages said the fix was not confirmed, and all 25 passed the hidden suite. They were right, but nobody had checked, and a message and a repository can disagree.

    What is a refused command?

    Some tools stop and ask you before they run a command. In the recorded runs nobody could answer, so anything outside a short allow-list was refused at once. Of 389 tool calls in 75 runs, 348 ran and 41 were refused: 18 shell commands that edit a file and 23 that run something other than the allowed test command. All 98 plain read-only shell commands ran, and 11 of the 23 other refusals were reads sent through xargs or find -exec. Your own tool's settings decide what is allowed for you.

    Do I need to know how to code to fix a bug with an agent?

    You need to read a short failing test and a small change line by line. The class practices that on five small Python repositories, and every solved recorded run changed one file with one edit. It does not teach Python itself. If a change is longer than you can read, treat that as a reason to send it back, not to trust it.

    What do I need to install to practice?

    Python 3.10 or newer (the eventdays repository asks for Python 3.11) and a terminal. Run python -m unittest discover -s tests -v inside a repository folder; pytest is optional. We ran that command on Windows with Python 3.14.7, and each repository showed 2 tests with 1 failing. We did not run the macOS or Linux versions of the commands.

    Is the class free, and do I need to sign up?

    The class is free. You do not need to sign up or give an email address. The five practice repositories, the one-page loop checklist and the start-here file are built in your browser from data on the page, and no repository folder holds a hidden test or a solution.

    Which AI model or tool should I use for a bug fix?

    This class does not compare models or tools. The 75 recorded runs came from three different models, and the class reports no figure for any one of them. Use the coding agent you already have, and let its own settings decide what it may run without asking. The model comparison is in class 96.

    What is a hidden test?

    A hidden test checks the same code on cases the visible test does not cover, and the agent never sees it. Each of the five repositories had a hidden suite, scored in a fresh folder after the run. In the 75 recorded runs, 0 passed the visible tests and then failed the hidden suite, so that case is hypothetical here, and you can write your own extra cases to stand in for it.

    What is an off-by-one error?

    It is a loop or a count that stops one step early or late. In the walkthrough run, a loop over a list stopped one step before the end and dropped the last result. The agent changed one line so the loop ran to the end, and both visible tests passed. It is one of the five planted bug types in the practice repositories.