Session list sorts by file mtime, which AI-title backfill clobbers — unrelated old sessions jump to "now"
Summary
The session/resume browser orders sessions by transcript file mtime. But Claude Code appends lines to old *.jsonl transcripts after a session is over — notably {"type":"ai-title",...} (and {"type":"mode",...}) when it generates/backfills the AI titles shown in that very list. Each append bumps the file's mtime to "now."
Result: opening or working in one session triggers a batch of title writes across several other, untouched sessions, so they all leap to the top of the list with a near-identical recent timestamp (e.g. five sessions all reading "8m"). This makes "which session did I last actually work in?" very hard to answer.
Repro
- Have several older sessions in a project.
- Start/resume work so titles get (re)generated.
- Observe multiple unrelated sessions now showing the same recent relative time at the top of the list.
Evidence
In the affected transcripts, the last line is type: ai-title / type: mode (no timestamp field), while the newest line that actually has a timestamp is hours or days older. The file mtime tracks the title append, not real activity. Ranking the same sessions by their newest real-message timestamp produces a correct, stable order that differs sharply from the mtime order.
Expected
Order the list by the newest real message timestamp in each transcript (ignoring ai-title / summary / mode lines), or store a dedicated "last activity" field, so metadata writes don't reorder the list.
Environment
- Claude Code in the VS Code extension
- Linux
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗