Claude Code session draft lost when app updates — input not persisted across Claude Code version upgrades

Status Fixed / completed
Reported on v2.1.63
Maintainer reply None cached
Activity 4 comments · opened Mar 9, 2026 · closed Mar 9, 2026

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

  1. Open a Claude Code session (via Desktop app or terminal)
  2. Begin typing a long message in the Claude Code input field (spend 30+ seconds typing)
  3. A Claude Code update becomes available (e.g., 2.1.63 → 2.1.64)
  4. The update proceeds (either auto-update or user-initiated)
  5. 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:

  1. The update process kills the Claude Code process (UtilityProcess terminated) without signaling a graceful shutdown
  2. The last auto-save may be up to 5 seconds stale
  3. After restart, Claude Code does not check for orphaned auto-save entries from the previous version
  4. 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 .ldb files (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 .ldb files but absent from live DB reads)

Suggested fix

  1. Pre-update flush: Before killing the Claude Code process for an update, signal it to flush the current input draft to persistent storage
  2. Post-update recovery: On startup after a version upgrade, check for orphaned auto-save drafts from the previous session and offer to restore them
  3. 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

View original on GitHub ↗

4 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/31844
  2. https://github.com/anthropics/claude-code/issues/29720
  3. https://github.com/anthropics/claude-code/issues/18755

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

COOLak · 7 months ago

Regarding the invalid label — this is specifically a Claude Code issue, not a general Desktop app issue:

  • The lost data is a Claude Code session draft (the user's input to Claude Code)
  • The auto-save mechanism that fails to persist is Claude Code's own draft save to Local Storage
  • The update that triggers the data loss is a Claude Code version upgrade (2.1.63 → 2.1.64)
  • The recovery gap is in Claude Code's session restoration — it doesn't check for orphaned drafts after a version upgrade

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.

COOLak · 7 months ago

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.

github-actions[bot] · 7 months ago

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.