claude-code - 💡(How to fix) Fix [BUG] Cross-session blindness causes three-stage failure: incomplete refactor → misdiagnosis → unauthorized revert [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60583Fetched 2026-05-20 03:54:47
View on GitHub
Comments
3
Participants
3
Timeline
8
Reactions
0
Timeline (top)
labeled ×5commented ×3

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.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • 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:

  1. Check git log for the file — when was it last changed, and what was the commit message?
  2. If a file is tracked but absent from the working tree, ask: "This looks intentionally removed — was it?"
  3. Never assume "missing = bug" for a tracked file without that confirmation

Before completing a refactor that removes a data source:

  1. Grep all consumers of the removed artifact
  2. Either migrate them in the same session or file a follow-up issue
  3. Do not commit a half-done removal

Related Issues

Claude Code Version

claude-sonnet-4-6 (Claude Code)

Platform

Windows 11 (WSL2 / Git Bash)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING