Add Claude data-export importer (parity with ChatGPT import)#6
Open
thoscut wants to merge 1 commit into
Open
Conversation
Adds an importer for Claude data exports (the ZIP downloaded from
claude.ai → Settings → Privacy → "Export data"), mirroring the existing
ChatGPT export import end to end.
- New src/claude-export.ts: preflight + resumable import job + dedup
ledger for Claude's format — single conversations.json array, flat
linear chat_messages (human/assistant, ISO timestamps), rich content
blocks (text/thinking/tool_use/tool_result/voice_note, token_budget
skipped), and text-only attachments via extracted_content. Also imports
design_chats/*.json through the same pipeline via a normalized thread
model; projects/ metadata is counted but not turned into sessions.
- New src/export-archive.ts: shared zip/folder reader, media sniffing and
small helpers factored out of chatgpt-export.ts so both importers reuse
the same battle-tested archive reader instead of duplicating it.
- Register the new import-only 'claude-export' source across types,
config, session titles and transfer-import bookkeeping.
- Server API: /api/claude-export/import/{preflight,status,start}; source
filter + display label.
- Electron file picker (main + preload) and full web UI: import card, JS
handlers, source color/badge/filter, and en/zh-CN/ja strings.
- scripts/claude-import-smoke.js (+ npm run smoke:claude-import) covering
parsing, block mapping, attachments, and re-run dedup.
Verified end to end against a real 319-conversation export (312 non-empty
threads imported, correct roles/blocks/timestamps, re-run dedups all) and
via the smoke test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CNrWLKk3T8wC2KbwDFJtnB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an importer for Claude data exports (the ZIP downloaded from claude.ai → Settings → Privacy → "Export data"), mirroring the existing ChatGPT export import end to end.
Verified end to end against a real 319-conversation export (312 non-empty threads imported, correct roles/blocks/timestamps, re-run dedups all) and via the smoke test.
Claude-Session: https://claude.ai/code/session_01CNrWLKk3T8wC2KbwDFJtnB