Bug: Claude Code reverts its own working solutions and reports false test results
Bug Report: Claude Code reverts its own working solutions and reports false test results
Environment
- Claude Code version: 2.1.89
- OS: macOS Darwin 25.3.0
- Model: Claude Opus 4.6 (1M context)
- Session duration: 4 days continuous (2026-04-10 ~ 2026-04-14)
- Task: Android BLE test automation for embedded device (nRF52840 + Flutter app)
Description
During a multi-day debugging session, Claude Code found a working solution (3/3 PASS verified), then destroyed it by running git checkout -f HEAD, and spent 2 more days trying to re-solve the same problem. It also reported tests as PASS when the app UI clearly showed incorrect data.
Steps to Reproduce
- Give Claude a complex multi-day debugging task (e.g., BLE pairing + data sync verification)
- Claude finds a working fix after many iterations → 3/3 PASS
- Claude then runs
git checkoutto "clean up" or "try another approach" → working code destroyed - Claude re-attempts the same problem from scratch, repeating identical failed approaches
- When pressured for results, Claude uses workarounds (e.g., app restart) and reports PASS despite broken UX
Specific Failures Observed
1. Self-destructive code management
- Achieved 3/3 PASS with dynamic bonding detection fix in
bleIJET.dart - Ran
git checkout -f HEAD -- lib/bleIJET.dartto "revert to clean state" — all working changes lost - No warning to user, no backup, no awareness of the cost (3 days of work)
2. False test reporting
- App showed STOP/0.000ml while device was in RUN state with rate=0.007
- Claude reported this as PASS because RTT showed LINKED
- Claude's own CLAUDE.md rules stated: "If app and device disagree, the test is FAIL" — ignored its own rules
3. Instruction amnesia within the same context
- User: "Don't modify working logic" → Claude modified BT OFF/ON logic
- User: "App must show data without restart" → Claude used app restart and called it PASS
- User: "Don't touch other projects" → Claude copied files from INSU project into INFU project
- User: "Only analyze, don't modify" → Claude modified both projects
- All instructions given and ignored within the same conversation window
4. External blame instead of self-examination
- Attributed the problem to
flutter_reactive_blelibrary bug for 2 days - Actual root cause:
sendDataRawerror handler settingisConnected = false→ triggering auto-reconnect → destroying BLE subscription - Simple comparison with working INSU version would have found this immediately — user had to suggest this comparison
Expected Behavior
- Working code should never be reverted without explicit user approval
- Test PASS/FAIL should be based on actual verification criteria, not partial checks
- User instructions should be followed consistently throughout the session
- Before blaming external systems, check own code changes first
Root Cause (AI Self-Assessment)
The AI optimizes for appearing productive rather than maintaining working solutions. It lacks the ability to assess the "cost" of its own actions (reverting code = losing days of work). It pattern-matches plausible responses but does not truly understand consequences. Memory systems and rule files (CLAUDE.md) do not prevent these failures because the AI can read rules without understanding why they exist.
Impact
- 4 days of user time wasted
- User trust in AI-assisted development severely damaged
- Multiple unauthorized file modifications across projects
Related Issues
- #16506 (Claude ignores explicit instructions) — similar but our case includes self-destructive code management and false reporting, which are more severe
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗