session-recall
Provides local, agentic semantic recall over Claude Code session history, enabling the agent to search past discussions semantically, expand turns, and grep transcripts.
README
session-recall
Local, agentic semantic recall over your Claude Code session history. It gives the agent four tools (via MCP) so it can resume past work instead of making you re-explain it:
recall_search(query)— find a past discussion by meaning (not substring).expand_around(session_id, uuid)— a cursor into the raw turn (tool calls, outputs, thinking).step(session_id, uuid, direction)— move to an adjacent turn (cheap cursor step).grep(pattern)— on-demand substring scan over the raw transcripts.
On-demand (no proactive auto-injection in v1). Local, open source.
recall_search and grep also take an optional scope_cwd — pass your current working
directory to scope results to the current repo (worktrees collapse to the repo root);
omit it for cross-project recall.
Status: v1, built and validated on real history. Key design rationale lives in docs/decisions/.
How it works
Only the conversation "surface" is indexed — user prompts and assistant text replies.
tool_result / thinking / harness noise are not embedded but stay reachable via
expand_around / grep. Embeddings: Voyage voyage-4-large (dim 1024) → SQLite
(sqlite-vec KNN + FTS5) → Voyage rerank-2.5 → top-k. Indexing is incremental
(by mtime+size). Subagent sidechains (<session>/subagents/) are intentionally skipped —
that's under-the-hood tooling, not conversation.
Embeddings are pluggable (Voyage is the default); the reranker is optional, and the system degrades gracefully to KNN + FTS without one.
Install / run
python -m venv .venv && .venv/bin/pip install -e .
export VOYAGE_API_KEY=... # your Voyage key
.venv/bin/session-recall index # index ~/.claude/projects
.venv/bin/session-recall search "query" # semantic search from the CLI
Connect to Claude Code (MCP)
claude mcp add session-recall --scope user -- \
/absolute/path/.venv/bin/python -m session_recall.server
The server reads VOYAGE_API_KEY from the environment; the tools (recall_search and
friends) become available to the agent in new sessions. Verify with
claude mcp list → ✔ Connected.
Keeping the index fresh
Indexing is incremental (it skips already-indexed files by signature), so staying fresh is
cheap. The most direct way is a Claude Code SessionStart hook that runs
session-recall index in the background at the start of each session. In
~/.claude/settings.json:
"hooks": {
"SessionStart": [
{ "hooks": [ {
"type": "command",
"async": true,
"command": "pgrep -f 'session-recall index' >/dev/null 2>&1 || (VOYAGE_API_KEY=... /abs/path/.venv/bin/session-recall index >/tmp/sr-index.log 2>&1 &)"
} ] }
]
}
The pgrep guard prevents overlapping runs; ( … & ) detaches so session start doesn't
wait. A launchd/cron timer works too. (Local on one machine is enough; a server-side
index only makes sense across several machines — at the cost of privacy and network.)
Privacy — hard invariant
This is a public repository. Only code goes in it.
- Data, indexes, raw transcripts, embeddings →
~/.local/share/session-recall/, outside the repo tree. They physically cannot be committed. - API keys → environment only (
VOYAGE_API_KEY);.gitignoreblocks.env. - Tests → synthetic fixtures only, never a real slice of a session.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。