[BUG] /desktop switch causes silent file state corruption — session handoff loses model + context, model edits based on stale history

Resolved 💬 3 comments Opened Apr 15, 2026 by Sahil170595 Closed May 25, 2026

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)

  1. Terminal session: 985 user messages across 8 active days (Mar 10 – Apr 15), iteratively editing a LaTeX resume
  2. File state at switch time: Skills section had been restructured weeks earlier (JAX/Horovod removed, LangGraph/LangSmith added, GPU & Inference split into two lines)
  3. User ran /desktop to move the session to Claude Desktop
  4. After switch: New model's first action was to "drop JAX and Horovod and add LangGraph" — changes already made 3+ weeks ago
  5. The model did not Read the file first — it acted on stale chat messages from early March as if they described current state
  6. 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:

  1. No temporal ordering of file state: Messages from March 10 and April 15 are presented with equal weight. The model cannot tell which Edit calls were superseded by later ones.
  1. 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.
  1. 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.
  1. Confidence without verification: The model makes Edit tool calls without first Read-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:

  1. Preserve the model — don't switch models just because the interface changed
  2. Preserve context — same session, same state, just rendered in Desktop instead of terminal
  3. 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 /desktop switch 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 /desktop workflow entirely: Users avoid /desktop because 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 — /model docs omit uncached history warning

Environment

  • Windows 11
  • Claude Code terminal → Claude Desktop via /desktop
  • Session: 985 messages, 4154 JSONL lines, 8 active days

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗