--resume picker omits sessions whose first JSONL line is a cwd-less queue-operation

Resolved 💬 2 comments Opened Jun 10, 2026 by yuyaoooooa Closed Jun 14, 2026

Summary

Sessions disappear from both the claude --resume interactive picker and the VS Code extension's "Local" session list, even though the .jsonl files are intact on disk and claude --resume <id> works fine. Users reasonably believe their conversation history was deleted.

Environment

  • CLI & VS Code extension 2.1.170 (also reproduced on 2.1.162)
  • macOS (darwin arm64)

Root cause (confirmed locally)

The picker buckets sessions per project by reading the first line of each .jsonl to get cwd. In current versions the first journaled line is often a queue-operation entry that has no cwd fieldcwd only appears on later lines, e.g.:

{"type":"queue-operation","operation":"enqueue","timestamp":"...","sessionId":"..."}

Sessions whose first line is such a queue-operation cannot be matched to the current directory and are silently dropped from the list. Resume-by-ID (claude --resume <id>) bypasses enumeration, so it still works — proving the data is intact and only the listing/enumeration is broken.

Repro

  1. Start a session and queue a message while Claude is busy (so the first journaled event is a queue-operation).
  2. End the session.
  3. Run claude --resume in that directory, or open the VS Code extension's Local list.
  4. The session is missing from the picker, but claude --resume <id> opens it fine.

Expected

The picker should derive cwd / sessionId from any line (or from the filename / a dedicated metadata record), not assume metadata is on line 1.

Impact

Multiple recent sessions vanish from the UI with no error, leading users to believe history was permanently lost.

---
🤖 Reported via Claude Code

View original on GitHub ↗

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