Conversation
Replace brute-force JSONL streaming search with a SQLite FTS5 index stored in the XDG cache directory. Searches are 15-72x faster with 76-90% less memory, and word-boundary matching eliminates false positives from substring matching (e.g. "bug" inside "debug"). New capabilities: - `cct index sync/rebuild/status` commands for index management - `--sort relevance` option for match-density ordering - `--sync` flag to force index refresh before searching - Incremental sync with 5-minute cache and change detection - Corruption auto-recovery (detects and rebuilds broken index) - Porter stemmer for natural language matching The old streaming search is preserved for single-session lookups (-s). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cct index sync/rebuild/statuscommands for index management--sort relevanceand--syncflags to search commandDetails
The old search scanned all JSONL session files on every query (~2s for ~1200 sessions). The new approach builds an FTS5 index in the XDG cache directory (
~/.cache/cct/index.db) with automatic incremental sync. Searches now complete in 50-140ms.Key design decisions:
-s(single-session) flag still uses the old streaming path since indexing one file is unnecessary overheadpre-committhat FTS5 tokenizes on punctuation fall back to substring scan when FTS returns zero results--syncflag bypasses thisThe "recall gap" between old substring matching and FTS5 was investigated across sessions and found to be entirely false positives (e.g. "bug" matching inside "debug").
Test plan
just cipasses (format, lint, tests)list,search,info,stats,export,changelog,plans,resume,index sync/rebuild/status)--sort relevancesurfaces sessions where the term is central vs incidental-sflag still uses streaming path🤖 Generated with Claude Code