wechat-exporter

Decrypt and export macOS WeChat chat history into plaintext SQLite databases.

213|43|Updated Jul 28, 2026
Ready to run
npx skills add https://github.com/robbin/wechat-exporter --skill wechat-exporter-robbin
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: wechat-exporter
Source: https://github.com/robbin/wechat-exporter
Command: npx skills add https://github.com/robbin/wechat-exporter --skill wechat-exporter-robbin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? WeChat on macOS stores all chat history in encrypted SQLCipher databases that cannot be opened with normal tools. This Skill automates the full pipeline of re-signing the WeChat app, extracting database encryption keys from memory, and decrypting every database into standard SQLite files you can query freely. ## Core Features & Use Cases - End-to-End Decryption Workflow: Installs dependencies, compiles the key scanner, re-signs WeChat, extracts keys, and decrypts contact, message, and session databases. - Version-Aware Refresh: Detects WeChat version changes and only re-extracts keys when needed, making incremental exports fast. - MCP Server Integration: Registers a local MCP server so Claude Code can query your decrypted chat history directly. - Use Case: You want to back up or search years of WeChat conversations. Run the skill, and it produces plaintext SQLite databases (contact.db, message_*.db, session.db) plus a queryable MCP interface. ## Quick Start Ask the assistant to export my WeChat chat history and it will guide you through installation, key extraction, and decryption step by step.

Frequently Asked Questions about wechat-exporter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I export WeChat chat history on macOS to SQLite?▼

Back up chats to the Mac WeChat client, then re-sign the app with codesign, extract database keys from memory using the find_all_keys_macos scanner with sudo, and run decrypt_db.py to produce plaintext SQLite databases for contacts, messages, and sessions.

How are WeChat message tables named in the decrypted database?▼

Each contact's messages live in a table named Msg_<md5>, where the hash is the MD5 of the contact's username. The Name2Id table lists usernames, so you compute MD5 hashes yourself to map usernames to their message tables.

Does this work on Windows or only macOS?▼

This workflow only supports macOS. It relies on macOS-specific paths like ~/Library/Containers/com.tencent.xinWeChat, the codesign tool, and a macOS key scanner binary, so Windows WeChat clients are not supported.

Why does WeChat key extraction fail after an app update?▼

WeChat updates change the memory layout, so previously extracted keys become invalid. You must re-sign the app with sudo codesign --force --deep --sign - and re-run the key scanner to generate a fresh all_keys.json.

Why does decryption fail with an HMAC verification error?▼

HMAC verification failure means config.json points to the wrong account directory. Identify the currently logged-in account folder under xwechat_files with the newest message_0.db modification time and update the db_dir path in config.json.

Is sudo access required to decrypt WeChat databases?▼

Yes, sudo is required twice: once to re-sign the WeChat app with codesign and once to run the memory key scanner, which must be executed manually in the terminal since it prompts for a password.