VS Code extension auto-update deletes CLI session history files

Resolved 💬 4 comments Opened Mar 17, 2026 by doogie77 Closed May 9, 2026

Description

After the Claude Code VS Code extension auto-updated overnight (to version 2.1.77), all CLI session history files were deleted from ~/.claude/sessions/. The npm-global CLI (@anthropic-ai/claude-code) was also removed, requiring manual reinstallation. 244 session files spanning 5+ weeks of work were permanently lost.

Environment

  • OS: Windows 11 Pro for Workstations 10.0.26200
  • Shell: Git Bash
  • Node.js: v24.13.0
  • Claude Code version: 2.1.77 (both VS Code extension and npm CLI)
  • VS Code extension ID: anthropic.claude-code-2.1.77-win32-x64

Timeline (all times EDT, 2026-03-16 / 2026-03-17)

  1. Mar 16, ~11:38 PM — VS Code auto-updated the Claude Code extension to 2.1.77. User reloaded the VS Code window to activate the update.
  2. Mar 17, morningclaude CLI command was no longer available (npm global package removed).
  3. Mar 17, 10:25 AM — Manually reinstalled via npm install -g @anthropic-ai/claude-code@2.1.77.
  4. Mar 17, 10:27 AM/resume showed "No conversations found to resume."

Evidence

Session files deleted

$ ls ~/.claude/sessions/
3816.json    # Only the current (new) session — all 243 prior sessions are gone

History metadata intact

$ wc -l ~/.claude/history.jsonl
4617         # 244 unique session IDs spanning back to Feb 6

history.jsonl survived but the actual session content files in sessions/ were deleted.

npm global state

The @anthropic-ai package in npm global node_modules shows LastWriteTime of 2026-03-17 10:25 AM (the reinstall). It was the only global package. The directory hadn't been modified since Feb 6 (original install) before the reinstall.

No other causes

  • No Windows Update patches (only Defender signature updates)
  • No BlueScreen (old dumps being rechecked by WER, not new crashes)
  • NVMe SSD healthy, all NTFS volumes healthy
  • No system restore activity
  • No other programs installed/uninstalled

Impact

  • 244 conversation sessions permanently lost (5+ weeks of history)
  • CLI silently removed, blocking startup the next morning
  • ~/.claude/ partially preserved (memory files, settings, history.jsonl, credentials intact) but sessions/ wiped

Expected Behavior

  • Extension auto-updates should not delete session history files
  • Extension auto-updates should not uninstall the npm-global CLI
  • If the CLI is being replaced by a bundled version, session data should be migrated

View original on GitHub ↗

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