Claude Code session draft lost when app updates — input not persisted across Claude Code version upgrades
Description
When Claude Code updates (e.g., from 2.1.63 → 2.1.64), any unsent message being composed in the Claude Code input field is permanently lost. The Claude Code session's draft auto-save mechanism writes to Local Storage approximately every 5 seconds, but the update process terminates the Claude Code process without triggering a final save. After the update, Claude Code does not restore the draft from the last auto-save snapshot either — the session appears empty.
This is a Claude Code data loss bug: the user's in-progress Claude Code input (which can be substantial — multi-paragraph prompts) is silently discarded during version upgrades.
Steps to reproduce
- Open a Claude Code session (via Desktop app or terminal)
- Begin typing a long message in the Claude Code input field (spend 30+ seconds typing)
- A Claude Code update becomes available (e.g., 2.1.63 → 2.1.64)
- The update proceeds (either auto-update or user-initiated)
- After update completes, reopen the Claude Code session
Expected behavior
The Claude Code draft should be preserved across version upgrades, either by:
- Claude Code flushing the current draft to persistent storage before the update kills the process
- Claude Code restoring the draft from the last auto-save snapshot after restarting post-update
Actual behavior
- The Claude Code session appears empty after the update — the draft is gone
- The auto-saved data is technically still present in LevelDB SSTable files (
.ldb) but is logically deleted and not recovered by Claude Code - Content typed between the last auto-save (~5 sec interval) and the update is permanently lost
Root cause analysis
Claude Code's draft auto-save writes to Chromium Local Storage (LevelDB) every ~5 seconds. During a version upgrade:
- The update process kills the Claude Code process (UtilityProcess terminated) without signaling a graceful shutdown
- The last auto-save may be up to 5 seconds stale
- After restart, Claude Code does not check for orphaned auto-save entries from the previous version
- The LevelDB entries are logically deleted during post-update cleanup
Technical evidence (forensic recovery from LevelDB)
I manually parsed the LevelDB SSTable files to recover the lost draft:
- Found 72 progressive auto-save snapshots across multiple
.ldbfiles (Snappy-compressed SSTable data blocks) - Snapshots span ~33 minutes of typing, one every ~5 seconds
- Final recovered snapshot: 4,297 characters (message was cut off mid-word — last ~30 seconds of typing lost)
- Auto-save entries stored as JSON:
{"value":"<draft>","tabId":"<id>","timestamp":<epoch_ms>} - After the update, these entries were logically deleted (physically present in
.ldbfiles but absent from live DB reads)
Suggested fix
- Pre-update flush: Before killing the Claude Code process for an update, signal it to flush the current input draft to persistent storage
- Post-update recovery: On startup after a version upgrade, check for orphaned auto-save drafts from the previous session and offer to restore them
- Increase auto-save frequency: Consider reducing the ~5 second auto-save interval for the input field, or flush on every keystroke pause (debounced)
Environment
- macOS (arm64)
- Claude Code updated from 2.1.63 → 2.1.64
- March 2026
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Regarding the
invalidlabel — this is specifically a Claude Code issue, not a general Desktop app issue:I've updated the description to clarify the Claude Code-specific scope. The core ask: Claude Code should persist and restore in-progress input drafts across version upgrades.
Closing this issue — the bug is in the Claude Desktop app's update lifecycle (Local Storage flush + draft recovery), not in Claude Code itself. Claude Code runs as a tab within the Desktop app; the draft auto-save, LevelDB storage, and update process are all Desktop app concerns.
Will report via feedback@anthropic.com instead.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.