Wechat Exporter — Communication skill for Claude Code
A Claude Code / Codex skill to export and decrypt WeChat (macOS) chat history into plaintext SQLite databases.
How to install Wechat Exporter
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open robbin/wechat-exporter and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Wechat Exporter does
A Claude Code / Codex skill to export and decrypt WeChat (macOS) chat history into plaintext SQLite databases.
Alternatives in Communication
- Lark Coding Agent Bridge — Bot that bridges Feishu/Lark messenger with a local Claude Code or Codex CLI 2.4k ★
- Qiaomu Anything To Notebooklm — Claude Skill: Multi-source content processor for NotebookLM 1.4k ★
- Nekro Agent — NekroAgent 是一个面向多人互动场景的跨平台 Agent 框架,集 Claude Code 沙盒执行、工作区编排、长期记忆、结构化 MCP 管理与可视化控制台于一体,兼具高扩展性、多模态交互、实时状态推送和自动化 800 ★
README
wechat-exporter
一个 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) / [Codex](https://openai.com/index/introducing-codex/) 技能(Skill),用于将 macOS 微信桌面端的本地聊天记录全量导出为明文 SQLite 数据库。
它能做什么
- 自动安装所需依赖(sqlcipher、Python 虚拟环境等)
- 对微信客户端进行重签名,从内存中提取数据库加密密钥
- 解密全部聊天记录数据库(联系人、消息、会话等)
- 输出为标准 SQLite 明文数据库,可直接用任何 SQL 工具查询
- 注册为 MCP Server,解密后可在 Claude Code 中直接查询聊天记录
前置条件
| 条件 | 说明 |
|---|---|
| macOS | 仅支持 macOS 系统 |
| 微信桌面端 | 需要已安装并登录微信 Mac 版 |
| 聊天记录已备份到电脑 | 在手机微信中将聊天记录迁移/备份到 Mac 端 |
| Claude Code 或 Codex | 用于运行本技能 |
| 终端完全磁盘访问权限 | 系统设置 → 隐私与安全性 → 完全磁盘访问权限 → 添加你的终端 |
快速开始
1. 安装技能
将技能添加到你的 Claude Code 技能目录。以下两种方式任选其一:
# 方式一:直接复制文件
cp SKILL.md ~/.claude/skills/wechat-exporter.md
# 方式二:创建目录(适合后续扩展)
mkdir -p ~/.claude/skills/wechat-exporter
cp SKILL.md ~/.claude/skills/wechat-exporter/skill.md
以上示例为全局安装(所有项目可用)。如需项目级安装,将 `~/.claude/skills/` 替换为 `<你的项目>/.claude/skills/`。
2. 运行
在 Claude Code 中输入:
导出微信聊天记录
或直接调用技能名:
/wechat-exporter
技能会一步步引导你完成整个过程,包括:
- 安装系统依赖(
brew install sqlcipher) - 下载并编译密钥扫描工具
- 对微信进行重签名(需要
sudo) - 提取数据库加密密钥(需要
sudo,需手动在终端执行) - 解密所有聊天数据库
- 输出导出摘要
3. 导出结果
解密后的数据库存放在 `~/wechat-decrypt-macos/decrypted/`:
decrypted/
├── contact/
│ └── contact.db # 联系人
├── message/
│ ├── message_0.db # 消息分片(按时间段切割)
│ ├── message_1.db
│ └── ...
├── session/
│ └── session.db # 会话列表
└── ...
所有数据库均为标准 SQLite 格式,可以用 `sqlite3`、DB Browser for SQLite 等任何工具直接查询。
数据库结构
联系人(contact.db)
`contact` 表中 `local_type` 字段含义:
| local_type | 含义 |
|---|---|
| 1 | 真实好友(双向添加) |
| 3 | 有过消息往来但未必是好友 |
| 0 | 服务号、系统通知 |
消息分片(message_*.db)
消息按**时间段**分片存储,`message_0.db` 通常是最近一年的主力库。每个联系人的消息存储在独立的 `Msg_` 表中,`` 为联系人 `username` 的 MD5 哈希值。
可通过 `Name2Id` 表建立 username 到表名的映射:
import hashlib, sqlite3
conn = sqlite3.connect("message_0.db")
for (username,) in conn.execute("SELECT user_name FROM Name2Id"):
table = "Msg_" + has
Related Skills
Wechat Persona Insight
微信聊天记录 → 人格画像与关系洞察:本地解密、行为统计、语言模式、抢功检测、单文件 HTML 报告 Local-first personality & relationship insights from decryp
Chat History
Search, inspect, and export Claude Code, Cursor & Codex history
Claude Code Chat Explorer
Browse, search, and explore your Claude Code conversation history with a fast SQLite-powered web interface
Old Claude MCP
Local MCP server that indexes exported Claude chat history into SQLite FTS5 for context retrieval
Do They Love Me Skill
Turn a two-person WeChat chat export into an evidence-based relationship analysis: interaction metrics, local
Imessage MCP
macOS-only iMessage MCP server for Claude Code. Direct chat.db read, voice-note transcription, FTS5 search, Ap
Related Agents
Worksheet Exporter
내보내기 전문가. 검수 통과 개체 트리(또는 레거시 HTML manifest)를 학생용/교사용 2벌로 분기하고 Chrome 헤드리스 --print-to-pdf로 A4 PDF(및 옵션 PNG)를 산출
SQL Expert
Expert SQL engineer for querying databases, writing cross-dialect SQL, inspecting schemas, and managing data a
Clean Architect
Plans clean implementation from approved clean behavioral specs and the clean destination foundation without r