# What should Claude Code do with a failing test that encodes the old requirement? — retained record

> Retained reddit record from reddit:ClaudeCode.

Canonical: https://highsignal.app/data/records/eb29006e10461f37

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeCode)  published 2026-11-02 17:05 ingested 2026-11-03 02:42

[original source ↗](https://www.reddit.com/r/ClaudeCode/comments/1xm2v1a/what_should_claude_code_do_with_a_failing_test/)

## retained text



```
A feature asks for longer display names. The patch makes the new example work, but an existing test insists that a name above the old limit must be rejected. Making that test green could mean restoring exactly the behavior the feature is supposed to change.



This is a fictional example. It isn't advice to delete a failing test whenever the task disagrees with it. The old limit might still protect a downstream system, or the new request might not cover every place the name appears.



I'm building Shifu around recovering decisions and constraints for coding tasks. Here I'd want the reason for the old limit, alongside the new requirement, before treating the test as either obsolete or authoritative.



The small planning note I'd give Claude Code is:



\- Old behavior and the requirement that introduced it.

\- Intended new behavior and where it applies.

\- Any downstream limit that still needs to hold.

\- Which old expectation should change, which should stay, and what remains unanswered.



Then I'd ask: "Explain each failing assertion in terms of the requested behavior change. Separate an expected contract change from a regression, and flag missing requirements before editing the expectations."



That is a proposed review prompt, not evidence the agent will classify failures correctly. A clear ticket and maintained contract may already provide everything needed. The point is to make the reason for changing a test reviewable, rather than make green the only goal.



When a feature intentionally changes an old behavior, what evidence do you require before updating its tests? Where do you keep the original reason if the test no longer expresses it?
```



document fetched 2026-11-03 00:41 · canonical https://reddit.com/r/ClaudeCode/comments/1xm2v1a/what_should_claude_code_do_with_a_failing_test
