session-finder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSession Finder
会话查找器
Semantic search across Claude Code sessions using Gemini embeddings.
使用Gemini嵌入对Claude Code会话进行语义搜索。
Commands
命令
Index sessions
为会话建立索引
bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py index [--max-age-days 90]bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py index [--max-age-days 90]Search
搜索
bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py search "query" [--top 5]bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py search "query" [--top 5]Open best match directly
直接打开最匹配的会话
bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py open "query"bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py open "query"Stats
统计信息
bash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py statsbash
python3 ~/.claude/skills/session-finder/scripts/session_finder.py statsHow it works
工作原理
- Document extraction — deterministic, no LLM. Each session JSONL is parsed into a structured document:
- events (pre-existing Claude recaps) if available
away_summary - First user message (task description)
- Follow-up user messages (condensed)
- First assistant response
- Tools used
- Project name
- Embedding — documents are embedded with via
gemini-embedding-exp-03-07CLIllm - Storage — SQLite at
~/.claude/session-finder.db - Search — query is embedded, cosine similarity ranks all sessions, top match is the default to open
- 文档提取 — 确定性流程,无需LLM。每个会话JSONL会被解析为结构化文档:
- 若存在事件(Claude已有的回顾内容)则包含
away_summary - 第一条用户消息(任务描述)
- 后续用户消息(精简版)
- 第一条助手回复
- 使用的工具
- 项目名称
- 若存在
- 嵌入处理 — 通过CLI使用
llm为文档生成嵌入向量gemini-embedding-exp-03-07 - 存储 — 存储在SQLite数据库中,路径为
~/.claude/session-finder.db - 搜索 — 为查询生成嵌入向量,通过余弦相似度对所有会话排序,默认打开最匹配的会话
Workflow
工作流程
When user asks to find a session:
- Run with their query
search - Present results with confidence scores
- Offer to resume the top match via
claude --resume <id>
当用户请求查找会话时:
- 使用用户的查询执行命令
search - 展示带有置信度分数的结果
- 提供通过恢复最匹配会话的选项
claude --resume <id>