wechat-export

Export WeChat chat history using chatlog server. Use when user mentions WeChat, exporting chats, chat history, or WeChat messages. Requires chatlog server running locally.

$ 安裝

git clone https://github.com/odysseus0/nix-config /tmp/nix-config && cp -r /tmp/nix-config/users/tengjizhang/claude/skills/wechat-export ~/.claude/skills/nix-config

// tip: Run this command in your terminal to install the skill


name: wechat-export description: Export WeChat chat history using chatlog server. Use when user mentions WeChat, exporting chats, chat history, or WeChat messages. Requires chatlog server running locally.

WeChat Chat Export

Export WeChat chat history using the chatlog local server.

Prerequisites

Steps

1. Find the contact's WeChat ID:

curl "http://127.0.0.1:5030/api/v1/contact?keyword=<name_or_alias>"

Returns: UserName (wxid), Alias, Remark, NickName

2. Export chat history:

curl "http://127.0.0.1:5030/api/v1/chatlog?time=<start>~<end>&talker=<wxid>&limit=2000" > output.txt

Parameters

ParamFormatExample
timeYYYY-MM-DD~YYYY-MM-DD2025-12-01~2025-12-03
talkerUserName or AliasHqt798317304 or jasonhu6
limitNumber2000 (increase for long chats)

Gotchas

  • Single-day queries (time=2025-12-02) may return empty — use a range instead
  • If recent messages are missing, manually trigger decrypt:
chatlog decrypt -d <data_dir> -k <data_key> -w <work_dir> -p darwin -v 4