Session picker shows 0-message sessions (empty preview)

Resolved 💬 3 comments Opened Apr 15, 2026 by kkauf Closed Apr 15, 2026

Problem

The session picker displays sessions with 0 messages. These show an empty preview pane, which is confusing — they look like broken versions of real sessions.

How to reproduce:

  1. Use isolation: "worktree" agents heavily (or have worktree-on-edit enabled)
  2. Worktrees get cleaned up after completion, but their project directories persist in ~/.claude/projects/ with empty/near-empty session files
  3. Open session picker and search — ghost sessions appear alongside real ones with the same name but 0 messages and no preview

Screenshots:

Working session (273 messages, preview visible):
The real session under kaufmann-health shows messages and a useful preview.

Broken session (0 messages, empty preview):
The same session name appears under kaufmann-health--claude-worktrees-fix-noshow-detection with 0 messages and a completely empty preview pane.

In my case, 113 worktree project directories accumulated in ~/.claude/projects/, 110 of which are completely empty and 3 have orphaned 0-message session files.

Proposed fix

Filter sessions with 0 messages from the session picker. These are never resumable and provide no value. This is a safe filter — a session with 0 messages was either never used or is an artifact of worktree cleanup.

This avoids needing to change worktree lifecycle management and cleanly solves the UX problem (empty previews, duplicate-looking entries in search results).

View original on GitHub ↗

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