Full-text search across Claude Code / Codex / pi conversations, for pi
中文版: README.zh-CN.md
Full-text search across every past AI conversation — from Claude Code (~/.claude/projects), Codex (~/.codex/sessions, ~/.codex/archived_sessions), and pi itself (~/.pi/agent/sessions).
- SQLite FTS5 with trigram tokenizer: substring matching works even for Chinese text without spaces
- Three calling shapes (auto-inferred, no mode argument):
session_search(query="...", limit=3)— Discovery: relevance-ranked search across sessionssession_search(session_id="...", around_message_id=12, window=10)— Scroll: locate context around a specific message in a sessionsession_search()— Browse: recent sessions, chronologically
- Incremental indexing: tracks file mtime/size per path, rebuilds only changed files; orphan entries are cleaned up
- Short-query fallback: queries with fewer than 3 searchable characters fall back to LIKE matching
- Output budgeting: results truncated to 45KB to respect pi's tool output limits
git clone https://github.com/Tieboyh/pi-session-search.git
ln -s ~/pi-session-search ~/.pi/agent/extensions/session-search
# /reload inside pi to activate; first indexing takes ~7s for hundreds of sessions- Index database:
~/.pi/agent/session-search.db(FTS5; Sessions keyed by(source, session_id)) - Index is built automatically on first use, then updated incrementally.