Skip to main content

SessionVault

统一提取、管理、搜索多个 AI 编程工具的本地对话历史。

支持工具: Claude Code · Codex CLI / App · Cursor · Antigravity


功能

  • 一键同步 — 从各工具本地存储提取对话,统一存入 SQLite
  • 全文搜索 — FTS5 引擎,秒级搜索所有历史对话
  • MCP 集成 — 在 Cursor / Claude Code 里直接搜索历史对话
  • 跨平台 — macOS / Windows / Linux 自动检测路径

安装

pip install -e .

如果需要 MCP 功能:

pip install -e ".[mcp]"

快速开始

1. 同步数据

# 同步所有工具
sessionvault sync

# 只同步某个工具
sessionvault sync --tool claude-code
sessionvault sync --tool codex
sessionvault sync --tool cursor

# 只同步最近 7 天
sessionvault sync --since 7d

# 预览不写入
sessionvault sync --dry-run

2. 搜索对话

# 搜索关键词
sessionvault search "牙齿"

# 按工具过滤
sessionvault search "医疗数据" --tool codex

# 按项目过滤
sessionvault search "导诊" --project medical

3. 查看统计

sessionvault stats
sessionvault projects
sessionvault sessions

4. 导出会话

sessionvault export <session-id>

MCP 集成

在 Cursor 或 Claude Code 里直接搜索你的历史对话。

Cursor 配置

编辑 ~/.cursor/mcp.json,添加:

{
  "mcpServers": {
    "sessionvault": {
      "command": "python3",
      "args": ["-m", "ai_conversations.mcp_server"]
    }
  }
}

如果 Cursor 找不到 python3,改成绝对路径,如 /usr/bin/python3 或 /opt/anaconda3/bin/python3

Claude Code 配置

在 ~/.claude/.mcp.json 中添加:

{
  "mcpServers": {
    "sessionvault": {
      "command": "python3",
      "args": ["-m", "ai_conversations.mcp_server"]
    }
  }
}

使用方式

配置完成后,在 Cursor / Claude Code 里直接问:

  • "搜索我之前讨论过的医疗数据治理相关对话"
  • "列出我所有工具的项目"
  • "我在 Codex 里讨论过什么?"

AI 会自动调用 sessionvault 工具搜索并返回结果。

数据来源

工具 数据位置 格式
Claude Code ~/.claude/projects/ JSONL
Codex CLI + App ~/.codex/sessions/ JSONL
Cursor ~/Library/Application Support/Cursor/ SQLite
Antigravity ~/Library/Application Support/Antigravity IDE/ SQLite

路径会根据操作系统自动适配(macOS / Windows / Linux)。

项目结构

sessionvault/
├── pyproject.toml
├── src/ai_conversations/
│   ├── cli.py              # CLI 入口
│   ├── db.py               # SQLite 数据库
│   ├── models.py           # 数据模型
│   ├── paths.py            # 跨平台路径检测
│   ├── mcp_server.py       # MCP 服务端
│   └── extractors/
│       ├── base.py         # 基类
│       ├── claude_code.py  # Claude Code
│       ├── codex.py        # Codex
│       ├── cursor.py       # Cursor
│       └── antigravity.py  # Antigravity
└── tests/

开发

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest tests/ -v

License

MIT

Metadata

Release files for sessionvault 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sessionvault 0.1.0
File Size Uploaded Provenance Actions
sessionvault-0.1.0.tar.gz 31.8 kB Without provenance Details for sessionvault-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sessionvault 0.1.0
File Interpreter ABI Platform Actions
sessionvault-0.1.0-py3-none-any.whl Python 3 none any Details for sessionvault-0.1.0-py3-none-any.whl

Total release size: 67.9 kB

Release files / sessionvault-0.1.0.tar.gz

Download URL sessionvault-0.1.0.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7e22c3bfa05e743a2d2da1f292af95f97200efbede1a73a69d1cb15839c482d2
BLAKE2b-256 checksum
How to use checksums
d5ea9b840950ae1b73fade551619747fe70a300ca5cd8945603e157dbb7ea46a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / sessionvault-0.1.0-py3-none-any.whl

Download URL sessionvault-0.1.0-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
886709e29b1f88ce11313de5fc16009b8e3b99d211b046d29bc6d2e2475fc2eb
BLAKE2b-256 checksum
How to use checksums
e778d4a5fd8454d0022dd21582ff68fa231e11e05dca0d6e3e6c282288211252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for sessionvault 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page