[BUG] Cross-session blindness causes three-stage failure: incomplete refactor → misdiagnosis → unauthorized revert
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information
Type of Behavior Issue
Claude ignored prior session context, made an incomplete change, and then in a subsequent session misdiagnosed the resulting breakage and undid intentional user work.
What Happened — Three Failures in Sequence
This is a single incident that illustrates a chain of failures caused by no cross-session memory of why a change was made.
Background: The project had a 22 MB static JSON file (\public/data/lexicons.json\) served on the UI. A previous Claude session identified this as a cause of UI lag and decided to remove it. The session removed the code that loaded the file. That was the correct decision.
---
Failure 1 — Incomplete refactor (Session A)
The session removed the code that fetched the file (\fetchLexicons\) but did not search for all code that consumed the loaded data. Multiple components depended on the result of that fetch (\lexEntry\, \jsonMeanings\, conditional renders for My Translation, Word Family, Lexicon tab sources). These were left in place, still gating UI features on \lexEntry\ being defined. The file was gone; the consumers were not.
No grep for dependents. No blast radius assessment. The refactor was half-done.
---
Failure 2 — Misdiagnosis in a new session (Session B — this session)
In a new session with no memory of Session A's decision, bugs were reported: the lexicon panel only showed one source, Word Family was missing, My Translation was missing. Session B investigated and found that \public/data/lexicons.json\ was absent from the working tree. It concluded this was the regression — the missing file was causing the broken UI.
The correct question to ask was: "This file was tracked in git and is now missing from the working tree — was this intentional?" That question was not asked.
---
Failure 3 — Unauthorized revert of intentional user work
Session B ran \git restore public/data/lexicons.json\, restoring the 22 MB file that had been deliberately removed as a performance fix. This undid intentional work without asking, without checking git history for context, and without reading the issue that motivated the removal.
The session only recognized the mistake after the user explicitly explained all three stages.
---
Root Cause
Claude has no memory across sessions of why a change was made — only that a change was made (visible from git). When Session B saw a missing file, it had no way to know whether that absence was a bug or a design decision. In the absence of that context, it defaulted to "missing = broken" and acted.
The auto-memory system (MEMORY.md) helps but cannot capture every intermediate design decision made during a session. The gap between "what git shows" and "why that state was chosen" is invisible to a new session.
Impact
- Intentional performance work was silently reverted
- The real fix (migrating UI consumers away from the static file to the existing API) was deferred another session
- User had to spend tokens correcting the regression, explaining the history, and filing this report
- Directly violates the "never hack things to work / find the real cause" rule in the project's CLAUDE.md
Expected Behavior
Before restoring any file from git (\git restore\, \git checkout\), Claude should:
- Check git log for the file — when was it last changed, and what was the commit message?
- If a file is tracked but absent from the working tree, ask: "This looks intentionally removed — was it?"
- Never assume "missing = bug" for a tracked file without that confirmation
Before completing a refactor that removes a data source:
- Grep all consumers of the removed artifact
- Either migrate them in the same session or file a follow-up issue
- Do not commit a half-done removal
Related Issues
- https://github.com/anthropics/claude-code/issues/19471 — CLAUDE.md ignored after context compaction (same cross-session memory gap)
- https://github.com/anthropics/claude-code/issues/28469 — Opus regression: memory loss, ignored instructions
Claude Code Version
claude-sonnet-4-6 (Claude Code)
Platform
Windows 11 (WSL2 / Git Bash)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗