claude-web-to-cowork
v1.2.0
Published
Import Claude web-exported conversations into Cowork (Claude Desktop) local sessions
Maintainers
Readme
claude-web-to-cowork
English
Import Claude web-exported conversations into Cowork (Claude Desktop) local sessions.
If you've exported your Claude.ai conversation history and want to browse them inside Claude Desktop's Cowork sidebar, this tool converts the web export JSON format into Cowork's local session format.
⚠️ Disclaimer
This is an unofficial, community-maintained tool. The Cowork session format is not publicly documented — it was reverse-engineered through observation. Format mismatches could cause Claude Desktop to behave unexpectedly. Always back up before importing.
Quick Start
# Install
npm install -g claude-web-to-cowork
# Diagnose your environment
cwtc doctor
# Back up existing sessions FIRST
cwtc backup
# List available conversations
cwtc list ./conversations.json
# Import a single conversation (by index)
cwtc import 0 ./conversations.json
# Or import everything
cwtc import-all ./conversations.json
# Restart Claude Desktop to see imported sessionsCommands
| Command | Description |
|---------|-------------|
| cwtc list <file> | List all conversations in the export file |
| cwtc search <keyword> <file> | Search conversations by title/summary |
| cwtc info <index\|uuid> <file> | Show conversation details |
| cwtc import <index\|uuid> <file> | Import a single conversation |
| cwtc import-all <file> | Import all conversations |
| cwtc imported | List already-imported sessions |
| cwtc remove <sessionId> | Remove an imported session |
| cwtc backup | Back up current Cowork sessions |
| cwtc import-memories <file> <dir> | Import memories into project memory directory |
| cwtc doctor | Diagnose environment |
How to Export from Claude Web
- Go to Claude.ai → Settings → Privacy → Export data
- Download the export archive
- Extract
conversations.jsonfrom the archive - Use it with this tool:
cwtc list ./conversations.json
Supported Platforms
- Windows:
%LOCALAPPDATA%\Claude-3p\local-agent-mode-sessions\ - macOS:
~/Library/Application Support/Claude/local-agent-mode-sessions/
How It Works
The tool converts Claude's web export format (a JSON array of conversation objects with chat_messages containing interleaved text, thinking, tool_use, and tool_result blocks) into Cowork's local session format:
local-agent-mode-sessions/{orgId}/00000000/
{sessionId}.json ← session metadata
{sessionId}/
.audit-key ← audit signing key
audit.jsonl ← audit log
.claude/
.claude.json ← Claude config
projects/{encoded-cwd}/
{cliSessionId}.jsonl ← conversation data (what Cowork reads)Known Limitations
- HMAC signatures: The audit log uses best-effort HMAC-SHA256. The exact algorithm used by Cowork is not publicly documented. This has not caused loading issues in testing.
- Attachments/Files: File attachments from web conversations are referenced but not imported (the actual file data is not included in the JSON export).
- macOS path: The macOS Cowork path is based on community reports and may differ by installation method.
API Usage
const { detectCoworkPaths, findTargetDir, convertConversation, writeSession } = require('claude-web-to-cowork');
const paths = detectCoworkPaths();
const target = findTargetDir(paths.sessionsDir);
const result = convertConversation(webConv, {
sessionsDir: paths.sessionsDir,
orgId: target.orgId,
});
writeSession(result);Building Standalone Binaries
npm run build:win # Windows .exe
npm run build:mac # macOS Intel
npm run build:mac-arm # macOS Apple Silicon
npm run build:all # All platforms中文
将 Claude 网页端导出的对话 JSON 导入为 Cowork(Claude Desktop)本地会话。
如果你导出了 claude.ai 上的对话历史,并希望在 Claude Desktop 的 Cowork 侧边栏中浏览它们,这个工具可以将网页导出格式转换为 Cowork 的本地会话格式。
⚠️ 免责声明
这是一个非官方、社区维护的工具。Cowork 会话格式未公开发布文档——它是通过逆向工程观察得出的。格式不匹配可能导致 Claude Desktop 出现异常行为。导入前务必备份。
快速开始
npm install -g claude-web-to-cowork
cwtc doctor # 诊断环境
cwtc backup # 先备份!
cwtc list ./conversations.json # 列出会话
cwtc import 0 ./conversations.json # 导入第 0 条
cwtc import-all ./conversations.json # 全部导入
# 退出并重启 Claude Desktop工作原理
将 Claude Web 导出格式(JSON 数组,每条会话包含 chat_messages,其中 text、thinking、tool_use、tool_result 块交织在一起)转换为 Cowork 本地会话格式。
支持的平台
- Windows:
%LOCALAPPDATA%\Claude-3p\local-agent-mode-sessions\ - macOS:
~/Library/Application Support/Claude/local-agent-mode-sessions/
已知限制
- HMAC 签名:审计日志使用最佳猜测的 HMAC-SHA256。Cowork 的确切算法未公开。测试中未因此导致加载问题。
- 附件/文件:Web 对话中的文件附件仅保留引用(实际文件数据不在 JSON 导出中)。
- macOS 路径:基于社区报告,可能因安装方式不同而有所差异。
License
MIT © 2026 chuiyu
