Skip to content

Session list performance: disk summary cache, display-name cache, and count alignment#111

Merged
wpak-ai merged 4 commits into
masterfrom
perf/session-list-summary-cache
Jul 3, 2026
Merged

Session list performance: disk summary cache, display-name cache, and count alignment#111
wpak-ai merged 4 commits into
masterfrom
perf/session-list-summary-cache

Conversation

@clean6378-max-it

@clean6378-max-it clean6378-max-it commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #109

Large installs were painful on cold start — every session list request re-parsed every .jsonl, and the landing page reopened files on every load just to get display names and counts. The in-memory LRU from #82 helps within a run but dies on restart.

This adds a SQLite summary cache (~/.claude-code-chat-browser/session_summary_cache.sqlite) keyed on path + mtime + exclusion-rules fingerprint. get_project_sessions skips the full parse when we already have a complete row. get_projects goes through the same cache for peek data instead of calling quick_session_info on every file every time.

Also cached display names in session_path.py — keyed on the project dir and max .jsonl mtime, so repeat landing page loads don't reopen files when nothing changed.

Project card session_count now uses the same titled-session filter as the session list when there are no exclusion rules. If exclusions are on, the card count can still diverge (same trade-off we accepted on cppa).

Partial cache rows from peeks get upgraded to full rows on the first session-list visit. mtime change = cache miss.

Files: utils/session_summary_cache.py (new), api/projects.py, utils/session_path.py, tests in test_session_summary_cache.py + integration/path tests.

To verify: run the test suite; optionally restart the server, hit a project session list twice — second request shouldn't touch get_cached_session for unchanged files. Touch one .jsonl and confirm only that one re-parses.

FTS search / search UX is separate — that's the Monday PR.

Summary by CodeRabbit

  • New Features
    • Project and session listings now leverage a disk-backed session summary cache keyed by path, file mtime, and exclusion rules to speed up repeat requests.
    • Added a cache for project display names to reduce repeated JSONL scanning.
  • Bug Fixes
    • Improved session counting/filtering by aligning untitled/excluded handling with cached summary completeness.
    • “Last modified” project activity is now derived from cached summary timestamps.
  • Tests
    • Added/updated integration and cache-coverage tests, including cache reuse, invalidation, and LRU eviction behavior.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude-code-chat-browser: Session list slow on large installs — disk summary cache, display-name cache, and count alignment

3 participants