Can Claude Code extend an existing suite without copying a defect into its tests?
Claude Code can inspect nearby tests and follow their patterns. That helps with fixtures and framework conventions. Give the agent a separate source for the expected result, particularly when the code under review already contains the wrong rule.
Separate house style from expected behaviour
Anthropic’s workflow asks Claude to examine neighbouring tests and cover edge cases. In a desk review of that guidance, the useful distinction is where each part of the test comes from. The fixture builder can come from the repository. The cut-off date on a cancellation rule should come from a signed-off example or an issue.
| Test choice | Inspect the generated code | A reason to revise |
|---|---|---|
| Expected dates | Literal dates from the acceptance example | The helper calls the same production calculation |
| Time control | A fixed clock and named time zone | The result depends on today or the host clock |
| Fixture reuse | Only fields needed for cancellation | Unrelated billing state obscures the assertion |
Ask a reviewer to change the implementation
Take a monthly cancellation with an effective date on the last day of the month. Ask for an example immediately before, at and after the cut-off. Change the comparison on purpose in a disposable branch. Read which test fails and whether the failure explains whose subscription has changed. Count the fixtures a maintainer must edit next year.