[BUG] Session cleanup purges all session transcripts across all projects

Open 💬 0 comments Opened Jul 6, 2026 by dpatey-one23

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary
A session cleanup ran automatically and deleted every session transcript (.jsonl files) across all projects in my ~/.claude/ directory. This affected two separate accounts (Team and Pro) on the same machine. The only surviving session is the one that was actively running when I discovered the issue.

Every project now shows "session not found on disk" when trying to access any prior session.

Details
Date: 2026-07-06
Cleanup timestamp: ~/.claude/.last-cleanup contains 2026-07-06T14:31:03.733Z
Platform: macOS (Darwin 24.6.0)
Affected accounts: Both a Team account and a personal Pro account
Scope: All projects — not isolated to one project directory
What was deleted
All .jsonl session transcript files under ~/.claude/projects/*/. The session index still references session IDs that no longer have corresponding files on disk, which produces the "session not found on disk" error.

What survived
The single currently-active session
Config backups in ~/.claude/backups/ (.claude.json.backup.* files — these are config snapshots, not session transcripts, so they don't help)
Expected behavior
Session cleanup should not delete transcripts for recent/active sessions across every project. At minimum:

Recent sessions (last N days) should be preserved
A warning or confirmation before bulk deletion would prevent silent data loss
Session transcripts should be backed up before cleanup, not just config files
Impact
Complete loss of conversation history, decisions, and context across all active projects. This is not recoverable.

What Should Happen?

Claude should not purge all session files without some warning.

Error Messages/Logs

Steps to Reproduce

Open Claude, observe that a cleanup has been executed and all session transcripts for all sessions have been lost

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗