Verify with Tests
"Done! The feature works" is a claim. A test run that passes is evidence. Much of this course comes down to one habit: never accept the claim without the evidence.
The rule
Done means a check passed, not that Claude said so.
Tests turn a fuzzy request into a target the agentic loop can hit. A few habits make them work well with an agent:
- Test first. Ask for a test that captures the requirement, and watch it fail before any feature code exists. A failing test proves it can tell "missing" from "present".
- Fail for the right reason. The failure should say the behaviour is missing ("expected 6 deliveries, got 7"), not that the test itself is broken by a typo or a bad import.
- Say how to run the checks. Put the command, such as
pytest -q, inCLAUDE.md, so Claude runs it on its own in every session. - Forbid the shortcut. "Don't change or skip the tests" closes the easiest way to fake a pass.
- Run it yourself.
! pytest -qat the end is your independent confirmation. - Go beyond unit tests when it matters: a linter, a type checker, or opening the app and trying the feature the way a customer would.
Write a test: pausing tomorrow removes exactly one delivery.
Run it and show me it fails. Don't write the feature yet.Now implement it in orders.py. Don't change or skip the test.
Run pytest -q until everything passes.Sending these as two separate messages matters. Ask for the test and the feature together and you never see the red step, so you cannot tell a test that detects the missing behaviour from one that would have passed anyway.