Local CLI conversations silently disappear from disk — multiple chats lost, JSONL files gone

Resolved 💬 5 comments Opened Apr 27, 2026 by jiriatipteldotorg Closed Jun 3, 2026

Summary

Three local Claude Code CLI conversations have vanished from disk over the last few days. They are not on web (I never use claude.ai/code), and they were not compacted away — the session JSONL files appear to have been deleted entirely. claude --resume no longer lists them.

Lost chats

  • ARCH: no SIP
  • ARCH: (COM) alert state
  • A third chat noticed earlier today (the trigger for asking what "no message yet" means)

All three were in worktree-based project sessions under ~/.claude/projects/-Users-<me>-<repo>--claude-worktrees-*/.

What I verified

Searched the entire local Claude Code state for content from these chats:

| Location | Result |
|---|---|
| All ~/.claude/projects/*/*.jsonl (471 project dirs) | No first-user-message starts with ARCH:; no JSONL line contains "ARCH: no SIP" or "ARCH: (COM) alert state" |
| Compaction summary lines ("type":"summary") | None present |
| ~/.claude.json + all 5 rotating backups | No chat-title registry; titles are derived from JSONL only |
| ~/.claude/history.jsonl | No matches |
| ~/.Trash/ | Empty |
| Time Machine | Not configured |

So the JSONL files have been removed from disk, not just the worktrees.

For context: 471 worktree project dirs are tracked in ~/.claude.json, but only 24 worktrees remain on disk — that part is normal; orphan project dirs persist for deleted worktrees. The bug is that for these specific chats, the project dir / JSONL itself was also removed.

Suspected cause

Some lifecycle event is deleting ~/.claude/projects/<slug>/ (and its .jsonl) for active conversations. Candidates:

  • ExitWorktree cleanup over-deletes session state instead of leaving the JSONL behind
  • A recent CLI upgrade ran a migration / pruning step that removed sessions
  • A hook or auto-cleanup tied to git worktree removal

Impact

Loss of conversation history, including chapter-marked architectural discussions I expected to be able to resume. No way to recover without backups. This has now happened at least 3 times.

Asks

  1. Investigate which code path can delete a populated ~/.claude/projects/<slug>/ directory
  2. Soft-delete (move to trash / archive) instead of unlinking, so users can recover
  3. Surface a warning when claude --resume notices a project dir referenced by ~/.claude.json is missing on disk
  4. Confirm whether there is any internal log/telemetry that could pinpoint when/why each session was removed (session IDs available on request)

Environment

  • Local CLI only (no web sessions involved)
  • macOS, ~/.claude/ layout includes projects/, sessions/, backups/, history.jsonl
  • Heavy worktree user (471 worktree project dirs ever created; 24 currently on disk)

View original on GitHub ↗

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