[BUG] /desktop switch causes silent file state corruption — session handoff loses model + context, model edits based on stale history
Preflight Checklist
- [x] I have searched existing issues and this has not been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Running /desktop to switch from Claude Code terminal to Claude Desktop does not port the session intact. Instead of preserving the model and context, it switches the model and triggers an uncached full-history re-read. The new model has no mechanism to distinguish current file state from historical file state. In long sessions with iterative file edits, this causes the model to make confident but incorrect Edit tool calls that revert files to outdated states.
This is a distinct failure mode from #46420 (context loss). Context loss is noticeable. This is silent corruption — the model acts authoritatively on stale data, and the user may not catch the regression.
What /desktop should do
Port the session as-is — same model, same context, same state. Just change the interface from terminal to Desktop.
What /desktop actually does
- Switches the model (not just the interface)
- Triggers an uncached full-history re-read with a different model
- Destroys temporal awareness — the new model treats all 985 messages as equally current
- Model acts confidently on weeks-old information without reading files first
Reproduction
Concrete Case (April 15 2026)
- Terminal session: 985 user messages across 8 active days (Mar 10 – Apr 15), iteratively editing a LaTeX resume
- File state at switch time: Skills section had been restructured weeks earlier (JAX/Horovod removed, LangGraph/LangSmith added, GPU & Inference split into two lines)
- User ran
/desktopto move the session to Claude Desktop - After switch: New model's first action was to "drop JAX and Horovod and add LangGraph" — changes already made 3+ weeks ago
- The model did not
Readthe file first — it acted on stale chat messages from early March as if they described current state - If the user hadn't caught it, the file would have been silently reverted to a 5-week-old state
Root Cause Analysis
When /desktop hands off to a new model with the full conversation history:
- No temporal ordering of file state: Messages from March 10 and April 15 are presented with equal weight. The model cannot tell which
Editcalls were superseded by later ones.
- Chat messages ≠ file state: Early messages say "the skills line contains
JAX, Horovod" — but the file was edited many times since. The model treats chat text as ground truth instead of reading the file.
- MEMORY.md is insufficient: Memory files capture architecture decisions but not line-level file contents. The gap between memory and actual file state is filled by stale chat context.
- Confidence without verification: The model makes
Edittool calls without firstRead-ing the file to verify current state, because the chat history gives it false confidence that it "knows" what's in the file.
Expected Behavior
/desktop should:
- Preserve the model — don't switch models just because the interface changed
- Preserve context — same session, same state, just rendered in Desktop instead of terminal
- If a model switch is unavoidable, inject a staleness warning so the model reads files before editing
Suggested Fix
Minimal fix (ship today): /desktop should not change the model. Port the session with the same model to Desktop.
If model switch is unavoidable: After the switch, inject a system message:
Note: This session was handed off from terminal to Desktop. File contents referenced in earlier messages may be outdated. Always use the Read tool to verify current file state before making edits.
Better fix: Track which files were modified during the session (already tracked in file-history-snapshot JSONL entries) and inject their current state or a staleness warning into the context after any model/interface switch.
Best fix: On any session handoff, append a "file state checkpoint" — a summary of all files modified during the session with their current content or hash, so the new model has ground truth.
Impact
- Data corruption: Files silently reverted to outdated states
- Trust erosion: Users cannot trust the model after a
/desktopswitch without manually verifying every edit - Disproportionate risk in long sessions: The longer the session, the more stale state exists, the worse the corruption
- Breaks the
/desktopworkflow entirely: Users avoid/desktopbecause it's destructive
Related Issues
- #46420 — Model provider switch resets conversation context (context loss variant; commented with this case as evidence)
- #46423 — Feature request for persistent context across switches
- #48087 —
/modeldocs omit uncached history warning
Environment
- Windows 11
- Claude Code terminal → Claude Desktop via
/desktop - Session: 985 messages, 4154 JSONL lines, 8 active days
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗