import-history
Import chat history from ChatGPT, Claude.ai, iMessage, Slack, WeChat, Telegram, Discord, or WhatsApp into Hawky memory
- License 许可
- Apache-2.0
- 所属仓库
- hao-ai-lab/hawky
- 最近更新
- 2026-10-01
- Stars
- ★ 33
- Forks
- 3
01 前言 Front Matter
- name
- import-history
- metadata
- {"hawky":{"emoji":"📥","always":true}}
- description
- Import chat history from ChatGPT, Claude.ai, iMessage, Slack, WeChat, Telegram, Discord, or WhatsApp into Hawky memory
- user-invocable
- true
02 资源文件 1
- 脚本flatten_chatgpt.py3.1 KB
03 SKILL.md 正文
import-history — Chat History Import
Import conversations from external platforms into Hawky's memory system. Each platform has a different export mechanism, but they all feed into the same distillation pipeline.
How to Use
Step 1: Ask which platforms the user uses.
Present the full list and ask them to pick which ones they want to import from:
Which platforms do you want to import history from? Pick all that apply:
1. ChatGPT (needs export ZIP)
2. Claude.ai (needs export ZIP)
3. iMessage (needs imessage-exporter CLI)
4. Slack (needs Slack skill or export ZIP)
5. WeChat (needs pre-exported files)
6. Telegram (needs Telegram Desktop export)
7. Discord (needs DiscordChatExporter CLI)
8. WhatsApp (needs mobile chat export)
Step 2: For each selected platform, follow its section below in order. Skip platforms the user didn't select.
Platform: ChatGPT
Prerequisites: User must export their data from ChatGPT first.
Steps:
- Tell user: "Go to ChatGPT → Settings → Data Controls → Export Data. You'll get an email with a download link. Download the ZIP file and tell me where it is."
- Once user provides the ZIP path, extract it:
unzip -o "<zip_path>" -d /tmp/chatgpt-import - Run the flatten helper to convert the tree-structured JSON to simple JSONL:
(Thepython3 "<skill_dir>/flatten_chatgpt.py" /tmp/chatgpt-import/conversations.json /tmp/chatgpt-import/flattened.jsonl<skill_dir>is the directory containing this SKILL.md file. Find it by searching forflatten_chatgpt.py.) - Read the flattened JSONL. Each line is:
{"title": "...", "timestamp": "...", "role": "user|assistant", "text": "..."} - Proceed to the Distillation section below.
If conversations.json has multiple shards (conversations-001.json, etc.), process each one.
Platform: Claude.ai
Prerequisites: User must export their data from Claude.ai first.
Steps:
- Tell user: "Go to Claude.ai → Settings → Privacy → Export Data. You'll get an email with a download link."
- Extract the ZIP:
unzip -o "<zip_path>" -d /tmp/claude-import - Shortcut — import memories directly: Check if
memories.jsonexists in the export. If so, read it — these are already-distilled facts that Claude stored about the user. Present them for review and save approved ones to MEMORY.md. This is the fastest path.
Each entry has acat /tmp/claude-import/memories.jsoncontentfield with a fact like "User prefers dark mode" or "User works on hawky project." - Full import — conversations: Read
conversations.json(JSON array, NOT JSONL). For each conversation, iteratechat_messages[]. Each message has:sender: "human" or "assistant"content: array of objects, collect items wheretype == "text"and join their.textfieldscreated_at: ISO 8601 timestamp
- Proceed to the Distillation section below.
Platform: iMessage
Prerequisites: imessage-exporter must be installed. Full Disk Access required for Terminal.
Steps:
- Check if installed:
which imessage-exporter - If not installed, tell user:
brew install imessage-exporter - Ask user if they want all messages or specific contacts:
- All:
imessage-exporter -f txt -o /tmp/imessage-export - Specific contact:
imessage-exporter -f txt -t "<name or phone>" -o /tmp/imessage-export - Date range: add
-s 2024-01-01 -e 2024-12-31
- All:
- Read the exported txt files from
/tmp/imessage-export/. Each file is one conversation. - Parse each file: lines follow the pattern
[timestamp] Sender: message text - Proceed to the Distillation section below.
Note: iMessage export can be LARGE (tens of thousands of messages). Suggest filtering by contact or date range to keep it manageable.
Platform: Slack
Two approaches:
If Hawky's Slack skill is configured:
- Ask which channels to import from
- Use the
readMessagesaction with pagination to walk backwards through history - Collect messages with timestamps and sender names
- Proceed to Distillation
If user has a workspace export ZIP:
- Extract the ZIP — it contains JSON files per channel per day
- Each JSON file has an array of message objects with
user,text,ts(timestamp) - User IDs need to be resolved to names (check
users.jsonin the export) - Proceed to Distillation
Platform: WeChat
Note: Direct WeChat database access tools have been taken down due to legal issues. This platform requires the user to pre-export their data using an external tool.
Steps:
- Tell user they need to export WeChat messages first using one of:
- BlueMatthew/WechatExporter (from iOS backup, outputs HTML/text)
- Manual copy-paste from WeChat desktop
- Once user provides the exported files (text, HTML, or JSON), read them
- Parse messages: look for patterns of
[timestamp] sender: messageor similar - Proceed to Distillation
Platform: Telegram
Prerequisites: Telegram Desktop app installed.
Telegram has the best native export of any platform — clean, complete JSON.
Steps:
- Tell user: "Open Telegram Desktop → Settings → Advanced → Export Telegram Data."
- Recommend settings: format = JSON, select which chats to include, optional date range
- User provides the export directory path
- Read the
result.jsonfile. Structure:{ "chats": { "list": [{ "name": "Chat Name", "type": "personal_chat", "messages": [{ "type": "message", "date": "2024-04-14T10:30:00", "from": "John Doe", "text": "Hello!" }] }] } } - For each chat, iterate
messages[].fromis the sender name,textis the content (can be string or array of text entities for formatted text),dateis ISO 8601. - Proceed to Distillation
Platform: Discord
Prerequisites: DiscordChatExporter CLI (or user provides pre-exported JSON).
Steps:
- Check if DiscordChatExporter is available. If not, tell user:
- Docker:
docker pull tyrrrz/discordchatexporter - Or download from https://github.com/Tyrrrz/DiscordChatExporter/releases
- Docker:
- User needs a Discord token (bot token from Developer Portal, or user token from browser dev tools)
- Ask which channels or DMs to export
- Run export:
docker run tyrrrz/discordchatexporter export \ -t "TOKEN" -c CHANNEL_ID -f Json -o /tmp/discord-export/ - Read the JSON output. Each file contains messages with
author.name,content,timestampfields. - Proceed to Distillation
If user has pre-exported JSON files, skip steps 1-4 and read them directly.
Platform: WhatsApp
Prerequisites: WhatsApp mobile app.
Steps:
- Tell user: "On your phone, open the chat you want to export → tap the contact/group name → scroll down → Export Chat → choose Without Media → send to yourself (email, AirDrop, etc.)."
- The export is a
.txtfile with this format:[1/15/24, 3:42:10 PM] John: Hey, how are you? [1/15/24, 3:42:30 PM] Jane: Good! Working on the project. - User provides the path to the
.txtfile(s) - Parse each line: extract timestamp, sender, and message text. Handle multi-line messages (continuation lines don't start with
[). - Proceed to Distillation
Limitation: WhatsApp mobile export caps at 40,000 messages without media. For larger histories, user can export multiple chats separately.
Distillation Pipeline
This is the shared step for ALL platforms after messages are collected.
Step 1: Batch by day
Group all collected messages by date (using the message timestamp). Process one day at a time.
Step 2: Distill facts
For each day's batch of messages, extract the most important facts about the user. Focus on:
- Recurring patterns — regular meetings, habits, routines
- Key contacts — who the user communicates with frequently, their roles
- Active projects — what the user is working on
- Preferences — tools, languages, frameworks, communication style
- Decisions — important choices the user made
- Deadlines and commitments — upcoming dates, promises made
- Personal context — timezone, location, job role, interests
Produce 3-10 bullet points per day. Skip days with only trivial chatter.
Step 3: Privacy gate
CRITICAL: Present ALL extracted facts to the user before saving ANYTHING.
Format:
I extracted these facts from your [platform] history:
1. You have a lab meeting every Tuesday at 2pm
2. Your main collaborators are Alice (ML) and Bob (frontend)
3. You're actively working on hawky
4. You prefer concise, direct communication
5. Your timezone is US Pacific
...
Which should I save? (all / select by number / none)
Step 4: Save to memory
Save approved facts to the workspace:
- Durable facts (preferences, contacts, recurring events) → append to
MEMORY.md - Time-specific context (project status, deadlines) → write to
memory/YYYY-MM-DD.mddaily logs - User profile updates (name, role, timezone) → update
USER.md
Avoid duplicating facts that are already in memory. Check existing MEMORY.md before adding.
Step 5: Report
Tell the user how many facts were imported and from which platform. Suggest they can re-run this anytime with /import_history or during /setup.
04 同仓库更多 Skills
summarize
Summarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).
slack
Use when the user asks you to read, search, send, or react in Slack — including reading channel history, DMs, searching messages, or posting as the user. Covers "check my Slack", "reply to Alice", "what's happening in
peekaboo
Capture and automate macOS UI with the Peekaboo CLI.
paper-search
Search academic papers on arXiv, Semantic Scholar, and DBLP
himalaya
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
gog
Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.