Skip to content

search: only the ~100 loaded sessions are searchable; main-side searchClaudeSessions (500-pool) is dead code #131

Description

@grimmerk

Current behavior (verified 2026-07-12)

Session search only covers the ~100 loaded sessions, and the main-side search API is dead code:

  1. Display path: the renderer loads getClaudeSessions(100) (src/switcher-ui.tsx:397) — the merged multi-account timeline sliced to the global top-100 by recency.
  2. Search path: the search box filters that same loaded list client-side via filterSessionsLocally (src/switcher-ui.tsx:384-393), matching against projectName/project/firstUserMessage/lastUserMessage/customTitle/branch/PR/assistantResponse/terminalBadge.
  3. Dead code: searchClaudeSessions (src/claude-session-utility.ts:186, pool = readClaudeSessions(500), result cap 50) is fully wired — IPC handler search-claude-sessions (src/main.ts:2329) + preload (src/preload.ts:81) — but no renderer code ever calls it.

Impact

With 414 unique sessions currently in history.jsonl (measured), ~314 sessions are unreachable: they are neither displayed nor searchable, no matter what keywords match them. This is a silent gap — the UI gives no hint that older sessions exist.

Notes

  • Widening the underlying pool is effectively free: readClaudeSessions caches the FULL unsliced session list (src/claude-session-utility.ts:178); the limits are applied per-call via slice.
  • Enrichment fields (branch/PR/AI response/custom title) only exist renderer-side for the loaded 100 — a full fix needs main-side search over all sessions (and all prompts, not just first/last), unioned with the client-side filter, with lazy enrichment for matches outside the loaded set.
  • Fix is planned as Batch 1 item A1 in docs/session-finding-plan.md (§4.2) — implemented by PR feat(sessions): Batch 1 — full-prompt search, match snippets, junk fold, highlight fix #132 (the dead searchClaudeSessions path was rewritten into the real main-side full-prompt search).
  • Related perf study note: perf: session tab switching performance regression (PR #103) #106 (comment on multi-account × limits).

🤖 On behalf of @grimmerk — generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions